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

时间:2017-05-28 22:27:22

标签: java maven google-app-engine google-cloud-endpoints google-cloud-endpoints-v2

我已按照Quickstart for Cloud Endpoints Frameworks on App Engine (Java)的说明进行操作,除了在本地运行外,一切正常。当我运行mvn appengine:run时,我收到失败消息,只收到503的/ _ah / start(无限次自动重试),我看到一个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)

我尝试了一个单独的系统/操作系统并收到了相同的结果。我错过了什么?或者做了一些改变,文档还没有更新?能够在本地调试非常重要

1 个答案:

答案 0 :(得分:2)

运行gcloud auth application-default login以解决此问题。我将更新官方文档。对由此带来的任何不便表示歉意!