【问题标题】:Cannot deploy HelloWorld App to Appspot无法将 HelloWorld 应用程序部署到 Appspot
【发布时间】:2017-05-31 23:55:57
【问题描述】:

我一直在关注这个关于如何从 Eclipse EE 部署到 Appspot 的 Udacity 教程。

https://classroom.udacity.com/courses/ud859/lessons/1215898636/concepts/14551185740923#

这里是写出来的说明...

https://docs.google.com/document/d/1EO3pQ53DQP3SW4LCnOLiUtgAKCWbqXVprBWj0TOlRUM/pub

我相信我已经做到了,但是当我尝试更新应用程序时,它坚持认为该项目不存在并给我一个 404 错误。但是,如果我去谷歌云平台,项目就在那里,我可以看到项目 ID。

我有,

  1. 将 appengine-web.xml 中的应用程序更改为项目 id hello-around-the-world-155900

  2. 根据提示授予 App Engine appcfg 权限

  3. 安装了 Google eclipse 插件并使用与项目所有者相同的帐户登录 Google

  4. 我正在使用 jdk 1.7.0_80 和 maven 3.3.9

  5. 新建了一个 App engine 项目并重启了我的电脑

这是我的 appengine-web.xml

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
    <application>hello-around-the-world-155900</application>
    <version>1</version>
    <threadsafe>true</threadsafe>
    <system-properties>
       <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
    </system-properties>
</appengine-web-app>

这是控制台日志,

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building helloworld 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> appengine-maven-plugin:1.9.4:update (default-cli) > package @ helloworld >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ helloworld ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\src\main\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ helloworld ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- appengine-maven-plugin:1.9.4:endpoints_get_discovery_doc (default) @ helloworld ---
[INFO] 
[INFO] Google App Engine Java SDK - get endpoints discovery doc...
[INFO] Using Class Name:com.google.training.helloworld.HelloWorldEndpoints
[INFO] Executing endpoints Command=[get-discovery-doc, -cp, C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\target\helloworld-1.0-SNAPSHOT\WEB-INF\classes;C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\target/classes;C:\Users\Joes1\.m2\repository\com\google\appengine\appengine-api-1.0-sdk\1.9.4\appengine-api-1.0-sdk-1.9.4.jar;C:\Users\Joes1\.m2\repository\com\google\appengine\appengine-endpoints\1.9.4\appengine-endpoints-1.9.4.jar;C:\Users\Joes1\.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar, -o, C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\target/generated-sources/appengine-endpoints/WEB-INF, -w, C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\target/generated-sources/appengine-endpoints, -f, rest, com.google.training.helloworld.HelloWorldEndpoints]
Jan 16, 2017 4:15:02 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\target/generated-sources/appengine-endpoints\WEB-INF/appengine-web.xml
API Discovery Document written to C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\target\generated-sources\appengine-endpoints\WEB-INF/helloworldendpoints-v1-rest.discovery
[INFO] Using Class Name:com.google.training.helloworld.HelloWorldEndpoints
[INFO] Executing endpoints Command=[get-discovery-doc, -cp, C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\target\helloworld-1.0-SNAPSHOT\WEB-INF\classes;C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\target/classes;C:\Users\Joes1\.m2\repository\com\google\appengine\appengine-api-1.0-sdk\1.9.4\appengine-api-1.0-sdk-1.9.4.jar;C:\Users\Joes1\.m2\repository\com\google\appengine\appengine-endpoints\1.9.4\appengine-endpoints-1.9.4.jar;C:\Users\Joes1\.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar, -o, C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\target/generated-sources/appengine-endpoints/WEB-INF, -w, C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\target/generated-sources/appengine-endpoints, -f, rpc, com.google.training.helloworld.HelloWorldEndpoints]
Jan 16, 2017 4:15:03 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\target/generated-sources/appengine-endpoints\WEB-INF/appengine-web.xml
API Discovery Document written to C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\target\generated-sources\appengine-endpoints\WEB-INF/helloworldendpoints-v1-rpc.discovery
[INFO] Endpoints discovery doc generation done.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ helloworld ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ helloworld ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ helloworld ---
[INFO] 
[INFO] --- maven-war-plugin:2.4:war (default-war) @ helloworld ---
[INFO] Packaging webapp
[INFO] Assembling webapp [helloworld] in [C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\target\helloworld-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp webResources [C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\target/generated-sources/appengine-endpoints] to [C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\target\helloworld-1.0-SNAPSHOT]
[INFO] Copying webapp resources [C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\src\main\webapp]
[INFO] Webapp assembled in [51 msecs]
[INFO] Building war: C:\Users\Joes1\Downloads\ud859-master\Lesson_2\000_Hello_Endpoints\target\helloworld-1.0-SNAPSHOT.war
[INFO] 
[INFO] <<< appengine-maven-plugin:1.9.4:update (default-cli) < package @ helloworld <<<
[INFO] 
[INFO] --- appengine-maven-plugin:1.9.4:update (default-cli) @ helloworld ---
[INFO] 
[INFO] Google App Engine Java SDK - Updating Application
[INFO] 
[INFO] Retrieving Google App Engine Java SDK from Maven
[INFO] Updating Google App Engine Application
Jan 16, 2017 4:15:05 PM java.util.prefs.WindowsPreferences <init>
WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
Reading application configuration data...
Jan 16, 2017 4:15:05 PM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXml
INFO: Successfully processed C:/Users/Joes1/Downloads/ud859-master/Lesson_2/000_Hello_Endpoints/target/helloworld-1.0-SNAPSHOT\WEB-INF/appengine-web.xml
Jan 16, 2017 4:15:05 PM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml
INFO: Successfully processed C:/Users/Joes1/Downloads/ud859-master/Lesson_2/000_Hello_Endpoints/target/helloworld-1.0-SNAPSHOT\WEB-INF/web.xml


Beginning interaction for module default...
0% Created staging directory at: 'C:\Users\Joes1\AppData\Local\Temp\appcfg2557241349360287827.tmp'
5% Scanning for jsp files.
20% Scanning files on local disk.
25% Initiating update.

com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=845830179642&version=1&
404 Not Found
This application does not exist (project_id=u'845830179642'). To create an App Engine application in this project, run "gcloud beta app create" in your console.

Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=845830179642&version=1&
404 Not Found
This application does not exist (project_id=u'845830179642'). To create an App Engine application in this project, run "gcloud beta app create" in your console.

Please see the logs [C:\Users\Joes1\AppData\Local\Temp\appcfg4148446068266547082.log] for further information.

有人可以就我所缺少的内容提供建议吗?这里似乎没有太多变数,而且很多人使用这项服务,所以一定有答案。

【问题讨论】:

  • 关闭 标记并重试。并打算使用 标签。
  • 抱歉,没有在堆栈溢出编辑器中正确缩进。应该像现在这样。
  • 您的 appengine-web.xml 文件似乎一切正常。我的猜测是您可能正在使用不同的帐户凭据来上传项目。甚至认为你提到你做了 appcfg 权限。请确保您使用正确的帐户。
  • 咦,这很奇怪,整个过程我只用了一个google账号。

标签: eclipse maven google-app-engine google-cloud-platform


【解决方案1】:

错误信息说:

This application does not exist (project_id=u'845830179642'). To create an App Engine application in this project, run "gcloud beta app create" in your console.

这里的问题是,你需要在 GCP 项目中创建一个App Engine application 才能进行部署。您可以在命令行中使用gcloud app create 命令来完成此操作(不再需要beta),也可以转到 Cloud Console 中的 App Engine 信息中心并创建它。

请参阅有关如何创建 GCP 项目和 App Engine 应用程序的文档:

https://cloud.google.com/appengine/docs/java/console/

【讨论】:

    猜你喜欢
    • 2015-03-22
    • 2014-07-21
    • 2018-09-06
    • 1970-01-01
    • 2013-05-14
    • 2015-10-25
    • 2012-10-30
    相关资源
    最近更新 更多