错误"您上传到新应用程序的第一个模块必须是'默认'模块"

时间:2014-11-05 21:43:04

标签: java google-app-engine maven

我正在尝试为Google App Engine提供多模块应用程序。我正在从sample code开发它。

我能够在开发服务器中成功运行我的应用程序但是当我尝试使用命令mvn appengine:update上传到Google App Engine时遇到以下错误:

Error Details:
Nov 05, 2014 11:58:15 AM org.apache.jasper.JspC processFile
INFO: Built File: /guestbook.jsp


com.google.appengine.tools.admin.HttpIoException: Error posting to URL: https://appengine.google.com/api/appversion/create?module=nbsocialmetrics-frontend&app_id=nbsocialmetrics&version=1&
400 Bad Request
The first module you upload to a new application must be the 'default' module.  Please upload a version of the 'default' module before uploading a version for the 'nbsocialmetrics-frontend' module. See the documentation for more information. Python: (https://developers.google.com/appengine/docs/python/modules/#Python_Uploading%20modules) Java: (https://developers.google.com/appengine/docs/java/modules/#Java_Uploading%20modules)

Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?module=nbsocialmetrics-frontend&app_id=nbsocialmetrics&version=1&
400 Bad Request
The first module you upload to a new application must be the 'default' module.  Please upload a version of the 'default' module before uploading a version for the 'nbsocialmetrics-frontend' module. See the documentation for more information. Python: (https://developers.google.com/appengine/docs/python/modules/#Python_Uploading%20modules) Java: (https://developers.google.com/appengine/docs/java/modules/#Java_Uploading%20modules)

Please see the logs [/var/folders/dp/v_lw6kqx16bf7743hs5t9phc0000gn/T/appcfg4483555174170807292.log] for further information.

除了修改模块名称外,我的设置与sample code几乎相同。

2 个答案:

答案 0 :(得分:2)

尝试从app.yaml删除以下行:

service: my-service

然后再次运行gcloud app deploy

答案 1 :(得分:1)

根据Google文档,应该至少有一个默认模块:

  

默认模块

     

每个应用程序都必须有一个默认模块。要定义默认模块,请在模块的appengine-web.xml文件中包含设置默认值,或保留设置。

     

还要确保将默认模块列为EAR目录的META-INF / application.xml文件中的第一个模块,如下例所示。   来源:https://cloud.google.com/appengine/docs/java/modules/

但是,这两个模块的appengine-web.xml文件中都有一个<application>标记。

我发现的解决方案是从appengine-web.xml文件中删除标记。