【问题标题】:Google Cloud Endpoints: Endpoints configuration not updatedGoogle Cloud Endpoints:端点配置未更新
【发布时间】:2017-01-13 14:16:06
【问题描述】:

我正在 Eclipse Mars(4.5) 上使用带有 Google Cloud SDK 1.9.48 的 Google Cloud Endpoints 构建一些业务 API。我一直在应用引擎上部署它们并使用 api explorer 进行测试。一段时间以来,我们添加了更多的 API,一切正常。奇怪的一天,我们观察到奇怪的行为,这对我们来说是个阻碍。尽管已部署应用程序,但端点部署失败。部署暂停 2-3 分钟(似乎连接到远程端点服务器。),然后继续忽略端点的故障。 端点部署失败并在 Eclipse 控制台上显示以下日志:

... 验证可用性:

Will check again in 1 seconds.
Will check again in 2 seconds.
Will check again in 4 seconds.
Will check again in 8 seconds.
Will check again in 16 seconds.
Will check again in 32 seconds.
Will check again in 60 seconds.
Endpoints configuration not updated.  The app returned an error when the Google Cloud Endpoints server attempted to communicate with it.
See the deployment troubleshooting documentation for more information: https://developers.google.com/appengine/docs/java/endpoints/test_deploy#troubleshooting_a_deployment_failure
Ignoring Endpoints failure and proceeding with update.
Closing update: new version is ready to start serving.

在应用引擎日志中,记录的错误如下:

/_ah/spi/BackendService.getApiConfigs java.lang.NullPointerException 在 com.google.api.server.spi.SystemServiceServlet.execute(SystemServiceServlet.java:102) 在 com.google.api.server.spi.SystemServiceServlet.doPost(SystemServiceServlet.java:73) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:637) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:717) ...

来自 servlet 的未捕获异常 java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/JsonNode 在 com.google.api.server.spi.SystemService$Builder.withDefaults(SystemService.java:517) 在 com.google.api.server.spi.SystemServiceServlet.createSystemService(SystemServiceServlet.java:133) ...

此处提供的故障排除链接没有多大帮助。 我怀疑,我的一些端点可能会导致此失败,但是以任何顺序评论端点类都无济于事。特别是,日志不能帮助我找到错误的 api 类。

【问题讨论】:

标签: google-app-engine google-cloud-endpoints


【解决方案1】:

我遇到了这个问题:

  1. 检查您的 web.xml 和 servlet 类是否映射良好。
  2. 检查您的一个类是否创建了另一个类的对象(在我的情况下是 Dao 类)并且两者都具有相同的 Objectify 对象.... [基本上如果你有class1,如果你正在创建一个class2的对象(比如说class1Dao和class2Dao)并且两者都有相同的Objectify objcty=..... 然后它发生在谷歌云端点服务器变得混乱]

这对我有帮助...基本上我做了一个非常粗鲁的解决方案, 我从Class1Dao 中删除了class2Dao 对象实例化,并将方法从class2Dao 剪切粘贴到class1Dao,这是我之前从Class1Dao 访问的。

替代解决方案是更改 Objectify 对象的名称。

示例:

在 class1 中对象化 objctfy1=.... 并在 class2 中对象化 objctfy2=....

希望这有帮助,我解释不好:)

【讨论】:

    猜你喜欢
    • 2019-10-27
    • 2023-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-05-16
    • 1970-01-01
    相关资源
    最近更新 更多