0

我配置并开发了一个内网应用程序,它结合了: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 连接仍然有效:订阅操作正常,并且从服务器成功接收到通知。

注意:我在同一个 glassfish 域中部署了示例 dojo-chat 应用程序(我将其作为模型),它运行良好!

我可能错过了什么?

4

1 回答 1

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 容器)而过滤器被评论的原因?!?

于 2012-11-06T17:00:53.707 回答