You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2015/03/13 16:10:13 UTC

[Bug 57704] New: NullPointerException at org.apache.catalina.core.StandardContext.listenerStop

https://bz.apache.org/bugzilla/show_bug.cgi?id=57704

            Bug ID: 57704
           Summary: NullPointerException at
                    org.apache.catalina.core.StandardContext.listenerStop
           Product: Tomcat 7
           Version: 7.0.59
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: minfrin@sharp.fm

During shutdown, tomcat crashes as follows:

SEVERE: Exception sending context destroyed event to listener instance of class
org.apache.tomcat.websocket.server.WsContextListener
java.lang.NullPointerException
        at
org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5076)
        at
org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5719)
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
        at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
        at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:672)
        at
org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1859)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)


An analysis of the code shows that getInstanceManager() is being called, and an
assumption is made that this call will always return not-null, which is not the
case. The rest of the code shows that there are valid situations where this
returns null.

5075     try {
5076     getInstanceManager().destroyInstance(listeners[j]);
5077     } catch (Throwable t) {
5078     t = ExceptionUtils.unwrapInvocationTargetException(t);
5079     ExceptionUtils.handleThrowable(t);
5080     getLogger().error
5081     (sm.getString("standardContext.listenerStop",
5082     listeners[j].getClass().getName()), t);
5083     ok = false;
5084     } 

The fix should be a simple null check on or around line 5076.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 57704] NullPointerException at org.apache.catalina.core.StandardContext.listenerStop

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=57704

Violeta Georgieva <vi...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #1 from Violeta Georgieva <vi...@apache.org> ---
Hi,

Fix is provided in trunk, 8.0.x for 8.0.21 and 7.0.x for 7.0.60 onwards.

Regards,
Violeta

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org