【问题标题】:Error "The first module you upload to a new application must be the 'default' module"错误“您上传到新应用程序的第一个模块必须是‘默认’模块”
【发布时间】:2014-11-05 21:43:03
【问题描述】:

我正在尝试为 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几乎相同。

【问题讨论】:

    标签: java google-app-engine maven


    【解决方案1】:

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

    service: my-service
    

    然后再次运行gcloud app deploy

    【讨论】:

    • 或者改成service: default
    【解决方案2】:

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

    默认模块

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

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

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

    我发现可行的解决方案是从 appengine-web.xml 文件之一中删除标签。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-02-04
      • 1970-01-01
      • 1970-01-01
      • 2020-11-10
      • 2018-12-03
      • 2019-03-16
      • 1970-01-01
      相关资源
      最近更新 更多