gpt4 book ai didi

google-app-engine - "HTTP ERROR: 500 No realm"运行 GWT 's "MobileWebApp"sample

转载 作者:太空宇宙 更新时间:2023-11-03 15:37:07 26 4
gpt4 key购买 nike

我正在尝试运行 GWT 2.4 示例应用程序“MobileWebApp”。当我尝试通过 Eclipse 在开发模式下运行应用程序时,出现 500“No Realm”错误。

我知道这是一个身份验证问题。

我不熟悉 Google App Engine 或 Jetty,但通过查看 web.xml,我可以看到有一个 servlet 过滤器,它使用 appengine UserService 大概将用户重定向到 Google 进行身份验证。

我正在使用:

  • Eclipse 3.7 (Indigo SR1)
  • 适用于 Eclipse 2.4 的 Google 插件
  • m2eclipse

我在下面包含了 web.xml 的摘录。我不确定还有哪些其他信息有助于诊断此问题。

  <security-constraint>
<display-name>
Redirect to the login page if needed before showing
the host html page.
</display-name>
<web-resource-collection>
<web-resource-name>Login required</web-resource-name>
<url-pattern>/MobileWebApp.html</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>*</role-name>
</auth-constraint>
</security-constraint>

<filter>
<filter-name>GaeAuthFilter</filter-name>
<!--
This filter demonstrates making GAE authentication
services visible to a RequestFactory client.
-->
<filter-class>com.google.gwt.sample.gaerequest.server.GaeAuthFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>GaeAuthFilter</filter-name>
<url-pattern>/gwtRequest/*</url-pattern>
</filter-mapping>

下面是 Eclipse 控制台的输出:

[WARN] Request /MobileWebApp.html failed - no realm
[ERROR] 500 - GET /MobileWebApp.html?gwt.codesvr=127.0.0.1:9997 (127.0.0.1) 1401 bytes
Request headers
Host: 127.0.0.1:8888
User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Response headers
Content-Type: text/html; charset=iso-8859-1
Content-Length: 1401

非常感谢任何有用的建议!

2011 年 11 月 11 日编辑:我添加了 Jetty 标签,因为它似乎与这个问题相关。

最佳答案

如果您的第一个请求失败,只是获取/MobileWebApp.html 页面,那么它可能不是身份验证问题。您是否为该项目启用了 GAE(不仅是 GWT)?这可能是一个问题。

我在某处读到有两种方法可以在 Eclipse 中调试应用程序,一种是使用 run as/webapp,但忘了是另一种(我不使用 Eclipse)。其中一个有效,另一个无效。

如果还是不行,你可以试试更换内置jetty:

  • 添加 GWT 参数:-server com.google.appengine.tools.development.gwt.AppEngineLauncher
  • 虚拟机参数:-javaagent:/path_to/appengine-agent.jar

最后一个选项是 -noserver,但是你将无法调试服务器端代码,只能调试客户端 GWT 的东西:首先使用 mvn jetty:run 启动 jetty,然后使用 -noserver 在 Eclipse 中调试GWT 参数

关于google-app-engine - "HTTP ERROR: 500 No realm"运行 GWT 's "MobileWebApp"sample,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8054472/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com