Skip to content

process.executeAsync(); Exception #1776

Open
@MJ19970128

Description

@MJ19970128

下記はappiumソース:AppiumDriverLocalService.javaのstartメソッド:

/**

  • Starts the defined appium server.

  • @throws AppiumServerHasNotBeenStartedLocallyException If an error occurs while spawning the child process.

  • @see #stop()
    */
    public void start() throws AppiumServerHasNotBeenStartedLocallyException {
    lock.lock();
    try {
    if (isRunning()) {
    return;
    }

     try {														
         process = new CommandLine(this.nodeJSExec.getCanonicalPath(),														
                 nodeJSArgs.toArray(new String[]{}));														
         process.setEnvironmentVariables(nodeJSEnvironment);														
         process.copyOutputTo(stream);														
         process.executeAsync();      //出了异常,在官网上提问下解决方案:这段代码出错一般是什么原因?如何让这个“进场创建”不出错?														
         ping(startupTimeout, timeUnit);														
     } catch (Throwable e) {														
         destroyProcess();														
         String msgTxt = "The local appium server has not been started. "														
                 + "The given Node.js executable: " + this.nodeJSExec.getAbsolutePath()														
                 + " Arguments: " + nodeJSArgs.toString() + " " + "\n";														
         if (process != null) {														
             String processStream = process.getStdOut();														
             if (!StringUtils.isBlank(processStream)) {														
                 msgTxt = msgTxt + "Process output: " + processStream + "\n";														
             }														
         }														
     												
         throw new AppiumServerHasNotBeenStartedLocallyException(msgTxt, e);  														
     }														
    

    } finally {
    lock.unlock();
    }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions