HTTP code 302 encountered when deploying on Google App Engine Endpoints

百般思念 提交于 2019-12-21 20:45:57

问题


When developing for App Engine Endpoints in Java using the official documentation, after running endpoints.cmd with the appropriate parameters and deploying in GAE, the dev server shows the proper endpoints at http://localhost:8888/_ah/api/discovery/v1/apis, but accessing the explorer for the production version on GAE shows old endpoints at https://<my-app>.appspot.com/_ah/api/discovery/v1/apis.

The error was traced to the HTTP 302 (moved temporarily) code found in the Logs of the production app for access to /_ah/spi/BackendService.getApiConfigs. Until that clears (i.e., gives HTTP 200), Google's servers won't be able to serve the endpoint (See this comment).


回答1:


This error stems in part due to inconsistent documentation. While the official documentation's sample web.xml uses a <security-constraint> block, that of the sample tictactoe app does not.

If you are getting a HTTP 302 status code, check the following two things (from this post):

  1. in your .api file in WEB-INF, change http to https in the bns declaration,
  2. remove the <security-constraint> block from your web.xml.

The above worked for me; not sure what the security constraint bit was about. Maybe a GAE admin can improve this answer?



来源:https://stackoverflow.com/questions/15246039/http-code-302-encountered-when-deploying-on-google-app-engine-endpoints

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!