在Google App Engine端点上部署时遇到HTTP代码302 [英] HTTP code 302 encountered when deploying on Google App Engine Endpoints

查看:115
本文介绍了在Google App Engine端点上部署时遇到HTTP代码302的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用官方文档为Java App Engine端点开发时>,在使用适当的参数运行endpoints.cmd并在GAE中进行部署之后,dev服务器将在 http:// localhost:8888 / _ah / api / discovery / v1 / apis ,但在GAE上访问生产版本的浏览器会在 https://< my-app> .appspot.com / _ah / api / discovery / v1 / apis

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.

错误发生在 HTTP 302 生产应用程序的日志以访问 / _ ah / spi / BackendService.getApiConfigs 。在清除之前(即提供HTTP 200),Google的服务器将无法为端点提供服务(请参阅此评论 )。

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

推荐答案

这个错误部分是由于文档不一致造成的。虽然官方文档的示例web.xml使用< security-constraint> 块,但是 sample tictactoe app does not。

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.

如果您获取 HTTP 302 状态代码,请检查以下两项内容(来自本文):

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


  1. bns http https 中的api文件$ c>声明

  2. 从web.xml中移除< security-constraint> 块。

  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.

以上工作适用于我;不确定安全约束是关于什么的。也许一个GAE管理员可以改进这个答案?

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

这篇关于在Google App Engine端点上部署时遇到HTTP代码302的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆