App Engine Cloud Endpoints Frameworks (Java) - 在本地 运行 时出现 NullPointerException

App Engine Cloud Endpoints Frameworks (Java) - NullPointerException when run locally

我已按照 Quickstart for Cloud Endpoints Frameworks on App Engine (Java) 的说明进行操作,除 运行 在本地安装外,一切正常。当我 运行 mvn appengine:run 收到失败消息时,/_ah/start 仅收到 503(无休止的自动重试),并且我看到 NullPointerException 堆栈跟踪。我看到了:

[INFO] GCLOUD: May 28, 2017 10:14:35 PM com.google.apphosting.utils.jetty.JettyLogger warn
[INFO] GCLOUD: WARNING: failed endpoints-api-configuration: java.lang.NullPointerException
[INFO] GCLOUD: May 28, 2017 10:14:35 PM com.google.apphosting.utils.jetty.JettyLogger warn
[INFO] GCLOUD: WARNING: Failed startup of context com.google.appengine.tools.development.DevAppEngineWebAppContext@45b4c3a9{/,/Users/clay/java-docs-samples/appengine/endpoints-frameworks-v2/backend/target/echo-1.0-SNAPSHOT}
[INFO] GCLOUD: java.lang.NullPointerException
[INFO] GCLOUD:  at com.google.appengine.api.appidentity.AppIdentityServicePb$GetAccessTokenResponse$Builder.setAccessToken(AppIdentityServicePb.java:6221)
[INFO] GCLOUD:  at com.google.appengine.api.appidentity.dev.LocalAppIdentityService.getAccessToken(LocalAppIdentityService.java:160)
[INFO] GCLOUD:  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] GCLOUD:  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] GCLOUD:  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] GCLOUD:  at java.lang.reflect.Method.invoke(Method.java:498)
[INFO] GCLOUD:  at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.callInternal(ApiProxyLocalImpl.java:541)
[INFO] GCLOUD:  at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:484)
[INFO] GCLOUD:  at com.google.appengine.tools.development.ApiProxyLocalImpl$AsyncApiCall.call(ApiProxyLocalImpl.java:461)
[INFO] GCLOUD:  at java.util.concurrent.Executors$PrivilegedCallable.run(Executors.java:533)
[INFO] GCLOUD:  at java.security.AccessController.doPrivileged(Native Method)
[INFO] GCLOUD:  at java.util.concurrent.Executors$PrivilegedCallable.call(Executors.java:530)
[INFO] GCLOUD:  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[INFO] GCLOUD:  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[INFO] GCLOUD:  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[INFO] GCLOUD:  at java.lang.Thread.run(Thread.java:745)

我在一个单独的系统上试过/OS,得到了相同的结果。我错过了什么?还是有些东西发生了变化,文档还没有更新?能够在本地调试非常重要

运行 gcloud auth application-default login 来解决这个问题。我会更新官方文档。不便之处,敬请谅解!