-
-
Notifications
You must be signed in to change notification settings - Fork 750
DEBUG o.atmosphere.cpr.DefaultBroadcaster Failed to execute a write operation for Broadcaster
jfarcand edited this page Oct 25, 2012
·
2 revisions
There is some scenarios where more than one thread start executing a broadcast operation. If the first thread broadcast and the connection is resumed by the browser or the server (closed), a WebServer can throw an exception like:
INFO: 11:46:35.375 [Atmosphere-AsyncWrite-2] DEBUG o.atmosphere.cpr.DefaultBroadcaster - Failed to execute a write operation for Broadcaster
java.lang.NullPointerException: null
at org.apache.catalina.connector.Request.setAttribute(Request.java:1689) ~[web-core.jar]
at org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:570) ~[web-core.jar]
at org.atmosphere.cpr.AtmosphereRequest.setAttribute(AtmosphereRequest.java:531) ~[atmosphere-runtime]
at org.atmosphere.cpr.DefaultBroadcaster.executeAsyncWrite(DefaultBroadcaster.java:731) ~[atmosphere-runtime]
at org.atmosphere.cpr.DefaultBroadcaster$3.run(DefaultBroadcaster.java:793) ~[atmosphere-runtime]
or
10:02:54.143 [http-nio-8080-exec-6] ERROR o.atmosphere.cpr.AtmosphereFramework - AtmosphereFramework exception
java.lang.IllegalStateException: Request object no longer valid. This object has been cancelled
at org.atmosphere.cpr.AtmosphereResourceImpl.getRequest(AtmosphereResourceImpl.java:503) ~[atmosphere-runtime-1.0.1.jar:1.0.1]
at org.atmosphere.cpr.AtmosphereResourceImpl.getRequest(AtmosphereResourceImpl.java:523) ~[atmosphere-runtime-1.0.1.jar:1.0.1]
at org.atmosphere.gwt.server.impl.GwtAtmosphereResourceImpl.getRequest(GwtAtmosphereResourceImpl.java:151) ~[atmosphere-gwt-server-1.0.1.jar:1.0.1]
at org.atmosphere.gwt.server.AtmosphereGwtHandler.doServerMessage(AtmosphereGwtHandler.java:279) ~[atmosphere-gwt-server-1.0.1.jar:1.0.1]
at org.atmosphere.gwt.server.AtmosphereGwtHandler.onRequest(AtmosphereGwtHandler.java:215) ~[atmosphere-gwt-server-1.0.1.jar:1.0.1]
at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java:256) ~[atmosphere-runtime-1.0.1.jar:1.0.1]
at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java:166) ~[atmosphere-runtime-1.0.1.jar:1.0.1]
at org.atmosphere.container.Tomcat7CometSupport.service(Tomcat7CometSupport.java:85) ~[atmosphere-runtime-1.0.1.jar:1.0.1]
at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java:1293) ~[atmosphere-runtime-1.0.1.jar:1.0.1]
at org.atmosphere.cpr.AtmosphereServlet.event(AtmosphereServlet.java:348) [atmosphere-runtime-1.0.1.jar:1.0.1]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilterEvent(ApplicationFilterChain.java:484) [catalina.jar:7.0.23]
at org.apache.catalina.core.ApplicationFilterChain.doFilterEvent(ApplicationFilterChain.java:377) [catalina.jar:7.0.23]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) [catalina.jar:7.0.23]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) [catalina.jar:7.0.23]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) [catalina.jar:7.0.23]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) [catalina.jar:7.0.23]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) [catalina.jar:7.0.23]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928) [catalina.jar:7.0.23]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) [catalina.jar:7.0.23]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) [catalina.jar:7.0.23]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987) [tomcat-coyote.jar:7.0.23]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539) [tomcat-coyote.jar:7.0.23]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1571) [tomcat-coyote.jar:7.0.23]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_03]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_03]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_03]
This exception is expected and properly handled by Atmosphere. The message may have been lost so it will be cached inside a BroadcasterCache (if one is installed). Most of the time the message will have been delivered successfully.
- Understanding Atmosphere
- Understanding @ManagedService
- Using javax.inject.Inject and javax.inject.PostConstruct annotation
- Understanding Atmosphere's Annotation
- Understanding AtmosphereResource
- Understanding AtmosphereHandler
- Understanding WebSocketHandler
- Understanding Broadcaster
- Understanding BroadcasterCache
- Understanding Meteor
- Understanding BroadcastFilter
- Understanding Atmosphere's Events Listeners
- Understanding AtmosphereInterceptor
- Configuring Atmosphere for Performance
- Understanding JavaScript functions
- Understanding AtmosphereResourceSession
- Improving Performance by using the PoolableBroadcasterFactory
- Using Atmosphere Jersey API
- Using Meteor API
- Using AtmosphereHandler API
- Using Socket.IO
- Using GWT
- Writing HTML5 Server-Sent Events
- Using STOMP protocol
- Streaming WebSocket messages
- Configuring Atmosphere's Classes Creation and Injection
- Using AtmosphereInterceptor to customize Atmosphere Framework
- Writing WebSocket sub protocol
- Configuring Atmosphere for the Cloud
- Injecting Atmosphere's Components in Jersey
- Sharing connection between Browser's windows and tabs
- Understanding AtmosphereResourceSession
- Manage installed services
- Server Side: javadoc API
- Server Side: atmosphere.xml and web.xml configuration
- Client Side: atmosphere.js API