示例项目“hello-world”项目在尝试在App引擎上运行时显示ERROR

时间:2016-02-29 03:21:18

标签: java maven google-app-engine google-cloud-platform google-managed-vm

我正在尝试部署" Hello,World!"适用于托管虚拟机Java 8的App on Engine上的Java,并且在运行mvn gcloud:deploy时面临下面列出的错误。在我的本地机器上运行它时没有遇到任何问题(mvn jetty:run)。有人可以指出我做错了什么吗?

[INFO] Building war: C:\Users\krajendran\AppData\Local\Google\Cloud SDK\java-docs-samples\managed_vms\helloworld\target\managedvms-helloworld-mvm-1.0-SNAPSHOT.war
[INFO]
[INFO] <<< gcloud-maven-plugin:2.0.9.95.v20160203:deploy (default-cli) < package @ managedvms-helloworld-mvm <<<
[INFO]
[INFO] --- gcloud-maven-plugin:2.0.9.95.v20160203:deploy (default-cli) @ managedvms-helloworld-mvm ---
[INFO] Running gcloud app deploy...
[INFO] Running python.exe -S C:\Users\krajendran\AppData\Local\Google\Cloud SDK\google-cloud-sdk\lib\gcloud.py --quiet preview app deploy C:\Users\krajendran\AppData\Local\Google\Cloud SDK\java-docs-samples\managed_vms\helloworld\target\appengine-staging/app.yaml --promote
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.340 s
[INFO] Finished at: 2016-02-28T21:37:22-05:00
[INFO] Final Memory: 18M/226M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.google.appengine:gcloud-maven-plugin:2.0.9.95.v20160203:deploy (default-cli) on project managedvms-helloworld-mvm: Could not start the dev app server: Cannot run program "python.exe" (in directory "C:\Users\krajendran\AppData\Local\Google\Cloud SDK\java-docs-samples\managed_vms\helloworld\target\appengine-staging"): CreateProcess error=2, The system cannot find the file specified -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

将-X添加到maven执行后,请找到完整的日志

[ERROR] Failed to execute goal com.google.appengine:gcloud-maven-plugin:2.0.9.95.v20160203:deploy (default-cli) on project managedvms-helloworld-mvm: Could not start the dev app server: Cannot run program "python.exe" (in directory "C:\Users\krajendran\AppData\Local\Google\Cloud SDK\java-docs-samples\managed_vms\helloworld\target\appengine-staging"): CreateProcess error=2, The system cannot find the file specified -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.google.appengine:gcloud-maven-plugin:2.0.9.95.v20160203:deploy (default-cli) on project managedvms-helloworld-mvm: Could not start the dev app server
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Could not start the dev app server
        at com.google.appengine.gcloudapp.AbstractGcloudMojo.startCommand(AbstractGcloudMojo.java:472)
        at com.google.appengine.gcloudapp.GCloudAppDeploy.execute(GCloudAppDeploy.java:43)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 20 more
Caused by: java.io.IOException: Cannot run program "python.exe" (in directory "C:\Users\krajendran\AppData\Local\Google\Cloud SDK\java-docs-samples\managed_vms\helloworld\target\appengine-staging"): CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
        at com.google.appengine.gcloudapp.AbstractGcloudMojo.startCommand(AbstractGcloudMojo.java:392)
        ... 23 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
        at java.lang.ProcessImpl.start(ProcessImpl.java:137)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
        ... 24 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

安装Python并将其添加到我的PATH后,我得到以下异常:

[ERROR] Failed to execute goal com.google.appengine:gcloud-maven-plugin:2.0.9.95.v20160203:deploy (default-cli) on project managedvms-helloworld-mvm: Error: gcloud app command exit code is: 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.google.appengine:gcloud-maven-plugin:2.0.9.95.v20160203:deploy (default-cli) on project managedvms-helloworld-mvm: Error: gcloud app command exit code is: 1
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error: gcloud app command exit code is: 1
        at com.google.appengine.gcloudapp.AbstractGcloudMojo.startCommand(AbstractGcloudMojo.java:463)
        at com.google.appengine.gcloudapp.GCloudAppDeploy.execute(GCloudAppDeploy.java:43)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 20 more
[INFO]   File "C:\Users\krajendran\AppData\Local\Google\Cloud SDK\google-cloud-sdk\lib\gcloud.py", line 53, in <module>
[ERROR]
[ERROR]
[INFO]     main()
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[INFO]   File "C:\Users\krajendran\AppData\Local\Google\Cloud SDK\google-cloud-sdk\lib\gcloud.py", line 31, in main
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[INFO]     import googlecloudsdk.gcloud_main
[INFO]   File "C:\Users\krajendran\AppData\Local\Google\Cloud SDK\google-cloud-sdk\lib\googlecloudsdk\gcloud_main.py", line 25, in <module>
[INFO]     import signal
[INFO]   File "C:\Users\krajendran\AppData\Local\Programs\Python\Python35\lib\signal.py", line 8, in <module>
[INFO]     _IntEnum._convert(
[INFO]   File "C:\Users\krajendran\AppData\Local\Google\Cloud SDK\google-cloud-sdk\lib\third_party\enum\__init__.py", line 366, in __getattr__

2 个答案:

答案 0 :(得分:1)

如前所述,安装Python并将其添加到路径并没有帮助。我遵循了两件事来使其发挥作用:

关注the link to add .PY extension to PATHEXT variable and edited PATH to add gcould - C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\lib\gcloud

还编辑了PATH以包含与google SDK捆绑在一起的Python路径 - C:\ Program Files(x86)\ Google \ Cloud SDK \ google-cloud-sdk \ platform \ bundledpython;

然后我遇到了谷歌SDK位置的问题,这是通过将配置添加到我的POM.xml来解决的:

<plugins>
      <plugin>
        <groupId>com.google.appengine</groupId>
        <artifactId>gcloud-maven-plugin</artifactId>
        <version>2.0.9.95.v20160203</version>
        <configuration>
            <gcloud_directory>C:/Program Files (x86)/Google/Cloud SDK/google-cloud-sdk</gcloud_directory>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>

答案 1 :(得分:0)

您是否已在搜索路径中安装了Python?

Caused by: java.io.IOException: Cannot run program "python.exe" (in directory "C:\Users\krajendran\AppData\Local\Google\Cloud SDK\java-docs-samples\managed_vms\helloworld\target\appengine-staging"): CreateProcess error=2, The system cannot find the file specified
    ...
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified

建议不要。