Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE from Wicket Atmospere support when shutting down Tomcat #812

Closed
0xabadea opened this issue Jan 10, 2013 · 3 comments
Closed

NPE from Wicket Atmospere support when shutting down Tomcat #812

0xabadea opened this issue Jan 10, 2013 · 3 comments

Comments

@0xabadea
Copy link

Bonjour,

We get this when shutting down Tomcat:

    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)

I am filing this against Atmosphere and not the Wicket support because it doesn't seem to me that the Wicket support is at fault.

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). Is this correct?

If I'm wrong, could you please suggest what the Wicket support could do better? Merci!

@jfarcand
Copy link
Member

Which version of Wicket/Atmosphere are you using? @papegaaij any idea? From the source code it seems there is an NPE when doing this

@0xabadea It is not an Atmosphere issue, so you may want to file an issue in Wicket as well.

@0xabadea
Copy link
Author

I filed https://issues.apache.org/jira/browse/WICKET-4965. Please close this one if the bug is not in Atmosphere.

Out of curiosity, how come it makes sense to invoke resume() on an AtmosphereResource whose handler has been destroyed?

@jfarcand
Copy link
Member

@0xabadea The resource may still be available for Broadcaster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants