Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
Atmosphere 1.0.5, wicket-atmosphere 0.5
Description
java.lang.NullPointerException: null at org.apache.wicket.atmosphere.EventBus.get(EventBus.java:86) at org.apache.wicket.atmosphere.AtmosphereBehavior.findEventBus(AtmosphereBehavior.java:85) at org.apache.wicket.atmosphere.AtmosphereBehavior.onDisconnect(AtmosphereBehavior.java:182) at org.atmosphere.cpr.AtmosphereResourceImpl.onDisconnect(AtmosphereResourceImpl.java:809) at org.atmosphere.cpr.AtmosphereResourceImpl.notifyListeners(AtmosphereResourceImpl.java:754) at org.atmosphere.cpr.AtmosphereResourceImpl.resume(AtmosphereResourceImpl.java:327) at org.atmosphere.cpr.DefaultBroadcaster.resumeAll(DefaultBroadcaster.java:315) at org.atmosphere.cpr.DefaultBroadcasterFactory.destroy(DefaultBroadcasterFactory.java:307) at org.atmosphere.cpr.AtmosphereFramework.destroy(AtmosphereFramework.java:930) at org.atmosphere.cpr.AtmosphereServlet.destroy(AtmosphereServlet.java:186) at org.apache.catalina.core.StandardWrapper.unload(StandardWrapper.java:1465) at org.apache.catalina.core.StandardWrapper.stopInternal(StandardWrapper.java:1823) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5463) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232) at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1575) at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1564) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)
The NPE occurs because the Wicket application has already been destroyed. It it destroyed by the Wicket filter's destroy() method, which is invoked by ReflectorServletProcessor.destroy(). AtmosphereFramework.destroy() first destroys the handler, and then it destroys the broadcast factory (which resumes the resources).
Jean-Francois says the bug is not in Atmosphere: https://github.com/Atmosphere/atmosphere/issues/812