我正在尝试运行 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 标签,因为它似乎与此问题相关。