{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/java-docs-samples/issues/922","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/java-docs-samples","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/java-docs-samples/issues/922/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/java-docs-samples/issues/922/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/java-docs-samples/issues/922/events","html_url":"https://github.com/GoogleCloudPlatform/java-docs-samples/issues/922","id":275044062,"number":922,"title":"Cloud Endpoints Frameworks for Java - Running and testing API backends locally not working","user":{"login":"caitlyn-organizer","id":33769463,"avatar_url":"https://avatars3.githubusercontent.com/u/33769463?v=4","gravatar_id":"","url":"https://api.github.com/users/caitlyn-organizer","html_url":"https://github.com/caitlyn-organizer","followers_url":"https://api.github.com/users/caitlyn-organizer/followers","following_url":"https://api.github.com/users/caitlyn-organizer/following{/other_user}","gists_url":"https://api.github.com/users/caitlyn-organizer/gists{/gist_id}","starred_url":"https://api.github.com/users/caitlyn-organizer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caitlyn-organizer/subscriptions","organizations_url":"https://api.github.com/users/caitlyn-organizer/orgs","repos_url":"https://api.github.com/users/caitlyn-organizer/repos","events_url":"https://api.github.com/users/caitlyn-organizer/events{/privacy}","received_events_url":"https://api.github.com/users/caitlyn-organizer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-18T01:58:46Z","updated_at":"2017-11-18T04:02:10Z","closed_at":null,"author_association":"NONE","body":"## In which file did you encounter the issue?\r\nhttps://cloud.google.com/endpoints/docs/frameworks/java/test-deploy#running_and_testing_api_backends_locally\r\n\r\n### Did you change the file? If so, how?\r\nI first tried what was in the doc. But that didn't work and after some googling and finding this issue thread https://github.com/GoogleCloudPlatform/java-docs-samples/issues/533, I tried the following:\r\nexport ENDPOINTS_SERVICE_NAME=endpointname-api.endpoints.projectid.goog\r\ngcloud config set project projectid\r\ngcloud auth application-default login\r\nmvn clean package\r\nmvn exec:java -DGetSwaggerDoc\r\ngcloud service-management deploy openapi.json\r\nmvn appengine:devserver\r\n\r\n## Describe the issue\r\nI get the exception below when running mvn appengine:devserver and a 503 when attempting to access http://localhost:8080/_ah/api/explorer or http://localhost:8080/_ah/admin. An important note is that this service is not the default service in the appengine project. Its appengine-web.xml service tag is campaign-service. I'm wondering if the instructions for running api backends locally is different for an appengine service other than default.\r\n\r\n[INFO] WARNING: failed endpoints-api-configuration: java.lang.IllegalStateException: could not get credentials for fetching service config!\r\n[INFO] Nov 18, 2017 1:16:38 AM com.google.apphosting.utils.jetty.JettyLogger warn\r\n[INFO] WARNING: Failed startup of context com.google.appengine.tools.development.DevAppEngineWebAppContext@7ce026d3{/,/Users/organizer/Development/repos/orgRepos/campaign-service/target/campaign-service-1.0.0-SNAPSHOT}\r\n[INFO] java.lang.IllegalStateException: could not get credentials for fetching service config!\r\n[INFO] \tat endpoints.repackaged.com.google.api.config.ServiceConfigSupplier.create(ServiceConfigSupplier.java:206)\r\n[INFO] \tat endpoints.repackaged.com.google.api.config.ServiceConfigFetcher.create(ServiceConfigFetcher.java:45)\r\n[INFO] \tat com.google.api.control.ServiceManagementConfigFilter$1.load(ServiceManagementConfigFilter.java:33)\r\n[INFO] \tat com.google.api.control.ConfigFilter.init(ConfigFilter.java:87)\r\n[INFO] \tat org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)\r\n[INFO] \tat org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)\r\n[INFO] \tat org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:662)\r\n[INFO] \tat org.mortbay.jetty.servlet.Context.startContext(Context.java:140)\r\n[INFO] \tat org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)\r\n[INFO] \tat org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)\r\n[INFO] \tat org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)\r\n[INFO] \tat org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)\r\n[INFO] \tat org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)\r\n[INFO] \tat org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)\r\n[INFO] \tat org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)\r\n[INFO] \tat org.mortbay.jetty.Server.doStart(Server.java:224)\r\n[INFO] \tat org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)\r\n[INFO] \tat com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:268)\r\n[INFO] \tat com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:284)\r\n[INFO] \tat com.google.appengine.tools.development.AutomaticInstanceHolder.startUp(AutomaticInstanceHolder.java:26)\r\n[INFO] \tat com.google.appengine.tools.development.AbstractModule.startup(AbstractModule.java:87)\r\n[INFO] \tat com.google.appengine.tools.development.Modules.startup(Modules.java:105)\r\n[INFO] \tat com.google.appengine.tools.development.DevAppServerImpl.doStart(DevAppServerImpl.java:274)\r\n[INFO] \tat com.google.appengine.tools.development.DevAppServerImpl.access$000(DevAppServerImpl.java:47)\r\n[INFO] \tat com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:219)\r\n[INFO] \tat com.google.appengine.tools.development.DevAppServerImpl$1.run(DevAppServerImpl.java:217)\r\n[INFO] \tat java.security.AccessController.doPrivileged(Native Method)\r\n[INFO] \tat com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:217)\r\n[INFO] \tat com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:368)\r\n[INFO] \tat com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:47)\r\n[INFO] \tat com.google.appengine.tools.development.DevAppServerMain.run(DevAppServerMain.java:223)\r\n[INFO] \tat com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:214)\r\n[INFO] \r\n[INFO] Nov 18, 2017 1:16:38 AM com.google.apphosting.utils.jetty.JettyLogger info\r\n[INFO] INFO: Started SelectChannelConnector@localhost:8080\r\n[INFO] Nov 18, 2017 1:16:38 AM com.google.appengine.tools.development.JettyContainerService startHotDeployScanner\r\n[INFO] INFO: Full scan of the web app in place every 5s.\r\n[INFO] Nov 18, 2017 1:16:38 AM com.google.appengine.tools.development.AbstractModule startup\r\n[INFO] INFO: Module instance campaign-service is running at http://localhost:8080/\r\n[INFO] Nov 18, 2017 1:16:38 AM com.google.appengine.tools.development.AbstractModule startup\r\n[INFO] INFO: The admin console is running at http://localhost:8080/_ah/admin\r\n[INFO] Nov 17, 2017 5:16:38 PM com.google.appengine.tools.development.DevAppServerImpl doStart\r\n[INFO] INFO: Dev App Server is now running\r\n"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/java-docs-samples/issues/comments/345416474","html_url":"https://github.com/GoogleCloudPlatform/java-docs-samples/issues/922#issuecomment-345416474","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/java-docs-samples/issues/922","id":345416474,"user":{"login":"frankyn","id":1907648,"avatar_url":"https://avatars1.githubusercontent.com/u/1907648?v=4","gravatar_id":"","url":"https://api.github.com/users/frankyn","html_url":"https://github.com/frankyn","followers_url":"https://api.github.com/users/frankyn/followers","following_url":"https://api.github.com/users/frankyn/following{/other_user}","gists_url":"https://api.github.com/users/frankyn/gists{/gist_id}","starred_url":"https://api.github.com/users/frankyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frankyn/subscriptions","organizations_url":"https://api.github.com/users/frankyn/orgs","repos_url":"https://api.github.com/users/frankyn/repos","events_url":"https://api.github.com/users/frankyn/events{/privacy}","received_events_url":"https://api.github.com/users/frankyn/received_events","type":"User","site_admin":false},"created_at":"2017-11-18T04:02:10Z","updated_at":"2017-11-18T04:02:10Z","author_association":"CONTRIBUTOR","body":"Hi @caitlyn-organizer,\r\n\r\nAre you running a specific sample? \r\nIf you're running the sample detailed here https://cloud.google.com/endpoints/docs/frameworks/java/get-started-frameworks-java then you should use the following updated commands for each action (the doc mentioned contain bugs and we are working on resolving them):\r\n\r\n\r\nSet the Google Cloud Project id in the [pom.xml](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/appengine-java8/endpoints-v2-backend/pom.xml#L37). This will update the value found in the [appengine-web.xml](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/appengine-java8/endpoints-v2-backend/src/main/webapp/WEB-INF/appengine-web.xml#L31).\r\n\r\nThen run the following commands:\r\n```\r\ngcloud config set project projectid\r\ngcloud auth application-default login\r\nmvn clean package\r\nmvn endpoints-framework:openApiDocs\r\ngcloud endpoints services deploy target/openapi-docs/openapi.json\r\nmvn appengine:run\r\n```"}}
{"actor":{"display_login":"frankyn"}}