Bug 51910 - NPE in comet processing when shutting down Tomcat
NPE in comet processing when shutting down Tomcat
Status: RESOLVED FIXED
Product: Tomcat 7
Classification: Unclassified
Component: Catalina
trunk
PC Windows XP
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2011-09-28 12:05 UTC by Konstantin Kolinko
Modified: 2011-10-01 14:13 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Kolinko 2011-09-28 12:05:19 UTC
I've hit it when testing 7.0.22 RC.

1. Configure Tomcat with NIO connector
2. Start Tomcat and open Comet chat example
http://localhost:8080/examples/jsp/chat/index.jsp
3. Type some Nickname and press button to start chat
The chat log will be in the second frame at the lower half of the page.
4. While chat log is active (Browser shows page as being loaded),
shut down Tomcat.
5. Observe NPE in the logs:

28.09.2011 15:55:32 org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-nio-8080"]
28.09.2011 15:55:33 org.apache.catalina.connector.CoyoteAdapter event
SEVERE: null
java.lang.NullPointerException
        at org.apache.catalina.core.StandardWrapperValve.event(StandardWrapperValve.java:354)
        at org.apache.catalina.core.StandardContextValve.event(StandardContextValve.java:192)
        at org.apache.catalina.valves.ValveBase.event(ValveBase.java:226)
        at org.apache.catalina.core.StandardHostValve.event(StandardHostValve.java:245)
        at org.apache.catalina.valves.ValveBase.event(ValveBase.java:226)
        at org.apache.catalina.valves.ValveBase.event(ValveBase.java:226)
        at org.apache.catalina.core.StandardEngineValve.event(StandardEngineValve.java:138)
        at org.apache.catalina.connector.CoyoteAdapter.event(CoyoteAdapter.java:211)
        at org.apache.coyote.http11.Http11NioProcessor.event(Http11NioProcessor.java:131)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.>
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1554)
        at org.apache.tomcat.util.net.NioEndpoint.processSocket(NioEndpoint.java:717)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.cancelledKey(NioEndpoint.java:1026)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.processKey(NioEndpoint.java:1169)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.timeout(NioEndpoint.java:1352)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:1085)
        at java.lang.Thread.run(Thread.java:662)
28.09.2011 15:55:33 org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
Comment 1 Konstantin Kolinko 2011-09-28 14:32:54 UTC
It is reproducible with APR connector as well.

===================
INFO: Stopping ProtocolHandler ["http-apr-8080"]
28.09.2011 18:31:25 org.apache.catalina.connector.CoyoteAdapter event
SEVERE: null
java.lang.NullPointerException
	at org.apache.catalina.core.StandardWrapperValve.event(StandardWrapperValve.java:354)
	at org.apache.catalina.core.StandardContextValve.event(StandardContextValve.java:192)
	at org.apache.catalina.valves.ValveBase.event(ValveBase.java:226)
	at org.apache.catalina.core.StandardHostValve.event(StandardHostValve.java:245)
	at org.apache.catalina.valves.ValveBase.event(ValveBase.java:226)
	at org.apache.catalina.valves.ValveBase.event(ValveBase.java:226)
	at org.apache.catalina.core.StandardEngineValve.event(StandardEngineValve.java:138)
	at org.apache.catalina.connector.CoyoteAdapter.event(CoyoteAdapter.java:211)
	at org.apache.coyote.http11.Http11AprProcessor.event(Http11AprProcessor.java:133)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:513)
	at org.apache.tomcat.util.net.AprEndpoint$SocketEventProcessor.run(AprEndpoint.java:1869)
	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)
28.09.2011 18:31:25 org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["ajp-apr-8009"]
===================
Comment 2 Mark Thomas 2011-10-01 14:13:39 UTC
Fixed in trunk and 7.0.x and will be included in 7.0.23 onwards.