3

我已按照App Engine (Java) 上的 Cloud Endpoints Frameworks Quickstart 的说明进行操作,除了在本地运行之外一切正常。当我运行时,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$1.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)

我尝试了一个单独的系统/操作系统并收到了相同的结果。我错过了什么?还是发生了一些变化而文档尚未更新?能够在本地调试非常重要

4

1 回答 1

2

运行gcloud auth application-default login以解决此问题。我会更新官方文档。对任何不便深表歉意!

于 2017-06-02T17:37:07.207 回答