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



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

[INFO] Building war: C:UserskrajendranAppDataLocalGoogleCloud SDKjava-docs-samplesmanaged_vmshelloworldtargetmanagedvms-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:UserskrajendranAppDataLocalGoogleCloud SDKgoogle-cloud-sdklibgcloud.py --quiet preview app deploy C:UserskrajendranAppDataLocalGoogleCloud SDKjava-docs-samplesmanaged_vmshelloworldtargetappengine-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:UserskrajendranAppDataLocalGoogleCloud SDKjava-docs-samplesmanaged_vmshelloworldtargetappengine-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:UserskrajendranAppDataLocalGoogleCloud SDKjava-docs-samplesmanaged_vmshelloworldtargetappengine-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:UserskrajendranAppDataLocalGoogleCloud SDKjava-docs-samplesmanaged_vmshelloworldtargetappengine-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:UserskrajendranAppDataLocalGoogleCloud SDKgoogle-cloud-sdklibgcloud.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:UserskrajendranAppDataLocalGoogleCloud SDKgoogle-cloud-sdklibgcloud.py", line 31, in main
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[INFO]     import googlecloudsdk.gcloud_main
[INFO]   File "C:UserskrajendranAppDataLocalGoogleCloud SDKgoogle-cloud-sdklibgooglecloudsdkgcloud_main.py", line 25, in <module>
[INFO]     import signal
[INFO]   File "C:UserskrajendranAppDataLocalProgramsPythonPython35libsignal.py", line 8, in <module>
[INFO]     _IntEnum._convert(
[INFO]   File "C:UserskrajendranAppDataLocalGoogleCloud SDKgoogle-cloud-sdklibthird_partyenum__init__.py", line 366, in __getattr__

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

已点击链接添加 。PY 扩展到 PATHEXT 变量并编辑 PATH 以添加 gcan - 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>

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

Caused by: java.io.IOException: Cannot run program "python.exe" (in directory "C:UserskrajendranAppDataLocalGoogleCloud SDKjava-docs-samplesmanaged_vmshelloworldtargetappengine-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

建议不。

相关内容

  • 没有找到相关文章

最新更新