3

I've followed the directions for the Quickstart for Cloud Endpoints Frameworks on App Engine (Java), and everything works except running it locally. When I run mvn appengine:run I receive failure messages, receive only 503's for the /_ah/start (with endless automatic retries), and I see a NullPointerException stacktrace. I'm seeing:

[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)

I tried on a separate system / OS and received the same results. Did I miss something? Or did something get changed and the docs haven't been updated yet? Being able to debug locally is pretty important

Clay H
  • 617
  • 7
  • 19
  • I'm having the same issue. Followed step by step and am getting the same failure: NullPointerException when trying to set the access token and a repeating 503 error. Also getting an error message about the working directory not being the same as the web application root. – Tyler May 29 '17 at 21:15
  • I'm have the exact same problem. I'm still fighting with it. I think it has something to do with using java 8. You have java 8 installed yeah? – shadyhossin May 31 '17 at 15:20
  • 1
    Can you run `gcloud auth application-default login` and try again? – saiyr Jun 01 '17 at 22:11
  • @saiyr That did it. Can you post as an answer so I can accept it? – Clay H Jun 02 '17 at 11:18
  • @shadyhossin Yeah I have java 8 installed. Could be a factor, but give saiyr's comment a try – Clay H Jun 02 '17 at 11:20

1 Answers1

2

Run gcloud auth application-default login to fix this issue. I will update the official docs. Apologies for any inconvenience!

saiyr
  • 2,535
  • 1
  • 9
  • 13