“HTTP错误:500无领域”运行GWT的“MobileWebApp”样品 [英] "HTTP ERROR: 500 No realm" running GWT's "MobileWebApp" sample
问题描述
我试图运行GWT 2.4示例应用程序MobileWebApp。当我尝试通过Eclipse以开发模式运行应用程序时,出现500No Realm错误。
我知道这是一个身份验证问题。 b
$ b
我不熟悉Google App Engine或Jetty,但是从web.xml中可以看到有一个servlet过滤器,它使用appengine UserService来推测将用户重定向到Google用于身份验证。
我正在使用:
- Eclipse 3.7 SR1)
- 适用于Eclipse 2.4的Google插件
- m2eclipse
我在下面的web.xml中添加了一段摘录。我不确定其他信息会对诊断这个问题有帮助。
< security-constraint>
< display-name>
在显示
主机html页面之前,必要时重定向到登录页面。
< / display-name>
< web-resource-collection>
< web-resource-name>需要登录< / web-resource-name>
< url-pattern> /MobileWebApp.html< / url-pattern>
< / web-resource-collection>
< auth-constraint>
<角色名称> *< /角色名称>
< / auth-constraint>
< / security-constraint>
< filter>
< filter-name> GaeAuthFilter< / filter-name>
<! -
此过滤器演示如何使GAE认证
服务对于RequestFactory客户端可见。
- >
< 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]请求/MobileWebApp.html失败 - 无域
[错误] 500 - GET /MobileWebApp.html?gwt.codesvr=127.0.0.1:9997(127.0 .0.1)1401字节
请求标题
主机:127.0.0.1:8888
用户代理: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
连接:keep-alive
响应标头
Content-Type:text / html; charset = iso-8859-1
Content-Length:1401
非常感谢任何帮助建议!
11/11/11编辑:我添加了Jetty标签,因为它似乎与此问题有关。
如果您的第一个请求失败,只需获取/MobileWebApp.html页面,那么它可能不是身份验证问题。你是否为该项目启用了GAE(不仅是GWT)?这可能是一个问题。
我在某处读到,在Eclipse中调试应用程序有两种方式,一种是以/ webapp身份运行,另一种是另一种(我不使用蚀)。其中一个工作,另一个不工作。
如果不行,您可以尝试更换内置的码头:
最后一个选项与-noserver一起使用,但不能调试服务器端代码,只是客户端GWT的东西:首先用mvn jetty启动jetty:运行,然后在Eclipse中用-noserver GWT param进行调试。
I'm trying to run the GWT 2.4 sample app "MobileWebApp". I get a 500 "No Realm" error when I try to run the app in dev mode through Eclipse.
I understand this is an authentication problem.
I'm not familiar with Google App Engine or Jetty but from looking at the web.xml I can see there is a servlet filter where it is using the appengine UserService to presumably redirect the user to Google for authentication.
I'm using:
- Eclipse 3.7 (Indigo SR1)
- Google Plugin for Eclipse 2.4
- m2eclipse
I'm including an excerpt from the web.xml below. I'm not sure what other info would be helpful in diagnosing this problem.
<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>
Below is the output in the Eclipse console:
[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
Many thanks for any helpful advice!
Edit on 11/11/11: I added Jetty tag since it seems relevant to this problem.
If your very first request fails, just getting the /MobileWebApp.html page, then it probably isn't an authentication problem. Do you have GAE enabled for that project (not only GWT)? That might be one issue.
I read somewhere that there's two ways of debugging an app in Eclipse, one is with run as/webapp, and forgot which was the other one (I don't use Eclipse). One of them works and another doesn't.
If that doesn't work, you can try replacing the built-in jetty:
- add a GWT param: -server com.google.appengine.tools.development.gwt.AppEngineLauncher
- VM param: -javaagent:/path_to/appengine-agent.jar
And the last option is with -noserver, but then you wont be able to debug the server-side code, just the client-side GWT stuff: first start jetty with mvn jetty:run and then debug in Eclipse with -noserver GWT param.
这篇关于“HTTP错误:500无领域”运行GWT的“MobileWebApp”样品的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!