java.io.IOException:在Atmosphere上使用长轮询时关闭

时间:2014-03-04 08:09:19

标签: java long-polling atmosphere dropwizard

我正在努力让大气长调查作为后备传输(对于像IE9这样的情况)。我对WebSocket作为传输没有任何问题。但是,当我尝试调用长轮询连接时,我收到以下错误:


org.atmosphere.cpr.AtmosphereResponse: 
! java.lang.RuntimeException: java.io.IOException: CLOSED
! at org.atmosphere.cpr.AtmosphereResponse.write(AtmosphereResponse.java:960)
! at org.atmosphere.cpr.AtmosphereResponse.write(AtmosphereResponse.java:925)
! at org.atmosphere.cpr.AtmosphereInterceptorWriter.writeReady(AtmosphereInterceptorWriter.java:89)
! at org.atmosphere.cpr.AtmosphereInterceptorWriter.invokeInterceptor(AtmosphereInterceptorWriter.java:78)
! at org.atmosphere.cpr.AtmosphereInterceptorWriter.write(AtmosphereInterceptorWriter.java:64)
! at org.atmosphere.cpr.AtmosphereInterceptorWriter.write(AtmosphereInterceptorWriter.java:59)
! at org.atmosphere.cpr.AtmosphereResponse$2.write(AtmosphereResponse.java:499)
! at org.atmosphere.cpr.AtmosphereResponse.write(AtmosphereResponse.java:894)
! at org.atmosphere.cpr.AtmosphereResponse.write(AtmosphereResponse.java:864)
! at org.atmosphere.interceptor.JavaScriptProtocol.inspect(JavaScriptProtocol.java:99)
! at org.atmosphere.cpr.AsynchronousProcessor.invokeInterceptors(AsynchronousProcessor.java:334)
! at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:208)
! at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:162)
! at org.atmosphere.container.Servlet30CometSupport.service(Servlet30CometSupport.java:101)
! at org.atmosphere.container.JettyServlet30AsyncSupportWithWebSocket.service(JettyServlet30AsyncSupportWithWebSocket.java:53)
! at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1692)
! at org.atmosphere.cpr.AtmosphereServlet.doPost(AtmosphereServlet.java:201)
! at org.atmosphere.cpr.AtmosphereServlet.doGet(AtmosphereServlet.java:187)
! at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
! at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
! at com.yammer.dropwizard.jetty.NonblockingServletHolder.handle(NonblockingServletHolder.java:47)
! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1448)
! at lithium.common.security.ServiceAuthFilter.doFilter(ServiceAuthFilter.java:57)
! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
! at com.yammer.dropwizard.servlets.ThreadNameFilter.doFilter(ThreadNameFilter.java:29)
! at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)
! at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)
! at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
! at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
! at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
! at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
! at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
! at com.yammer.metrics.jetty.InstrumentedHandler.handle(InstrumentedHandler.java:200)
! at org.eclipse.jetty.server.handler.GzipHandler.handle(GzipHandler.java:264)
! at com.yammer.dropwizard.jetty.BiDiGzipHandler.handle(BiDiGzipHandler.java:123)
! at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
! at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
! at org.eclipse.jetty.server.Server.handle(Server.java:364)
! at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
! at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)
! at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)
! at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)
! at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
! at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
! at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
! at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
! at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
! at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
! at java.lang.Thread.run(Thread.java:744)
Caused by: ! java.io.IOException: CLOSED
! at org.eclipse.jetty.http.gzip.AbstractCompressedStream.checkOut(AbstractCompressedStream.java:298)
! at org.eclipse.jetty.http.gzip.AbstractCompressedStream.write(AbstractCompressedStream.java:205)
! at org.atmosphere.cpr.AtmosphereResponse.write(AtmosphereResponse.java:951)
!... 48 common frames omitted

我使用大气javascript来初始化连接,而代码几乎与示例相似。

var socket = $.atmosphere;
var request = {
    contentType : "application/json",
    url : the-url,
    transport : 'websocket',
    fallbackTransport : 'long-polling'
};

socket.subscribe(request);

0 个答案:

没有答案