我配置并开发了一个内联网应用程序,它结合了:spring 3.0.5(包括安全性)+ CometD 2.3.1。
为了设置cometd,我提到: http://docs.cometd.org/2.4.3/reference/#java_server_services_integration_spring
当我在码头上运行我的应用程序时,一切正常。但是当我尝试在glassfish v2中运行它时,我“随机”获取HTTP 408。 server.log中的错误:
[#|2012-11-02T15:43:50.428+0100|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=17;_ThreadName=httpSSLWorkerThread-9000-0;_RequestID=eb9ebc97-ac0f-48fe-8793-cfc9fd3e7b3a;|StandardWrapperValve[default]: PWC1406: Servlet.service() for servlet default threw exception
java.lang.IllegalStateException
at org.apache.coyote.tomcat5.CoyoteResponseFacade.sendError(CoyoteResponseFacade.java:433)
at javax.servlet.http.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:141)
at org.springframework.security.web.context.SaveContextOnUpdateOrErrorResponseWrapper.sendError(SaveContextOnUpdateOrErrorResponseWrapper.java:54)
at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:740)
at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:384)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
从IE客户端的角度来看,我的cometD连接不稳定:
13:16:16 - CometD Connection Established
13:16:16 - CometD Connection Broken
13:16:17 - CometD Connection Established
13:16:17 - CometD Connection Broken
13:16:20 - CometD Connection Established
13:16:20 - CometD Connection Broken
13:16:21 - CometD Connection Established
13:16:21 - CometD Connection Broken
13:16:22 - CometD Connection Established
13:16:23 - CometD Connection Broken
但是尽管有错误消息,但是cometd连接仍然有效:订阅操作正常,并且从服务器成功收到通知。
Nota:我在同一个glassfish域中部署了示例dojo-chat应用程序(我作为模型)并且工作正常!
我可能错过了什么?
答案 0 :(得分:0)
事实上,我在cometD示例WAR中找到了答案(在web.xml文件中):
<!-- Portability Filter, needed only to run on non Jetty or non Servlet-3.0 containers -->
<filter>
<filter-name>continuation</filter-name>
<filter-class>org.eclipse.jetty.continuation.ContinuationFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>continuation</filter-name>
<url-pattern>/cometd/*</url-pattern>
</filter-mapping>
此过滤器不在我的web.xml中。 我不明白的一点是,为什么演示应用程序工作正常(使用相同的servlet容器),而过滤器被评论了?!?