Bug 50405 - Null Pointer Exception at Coyote Adapter
Summary: Null Pointer Exception at Coyote Adapter
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 7
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 7.0.5
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-02 18:59 UTC by Eduardo
Modified: 2011-01-28 10:57 UTC (History)
1 user (show)



Attachments
A simple test application that presents the error reported. (335.39 KB, application/octet-stream)
2011-01-25 18:03 UTC, Miguel Hernandez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eduardo 2010-12-02 18:59:46 UTC
I am using Tomcat 7.0.5 on Windows 7 and Fedora (this issue happens in both), using the Http11NioProtocol for a SSL connection with a self-signed certificate.
Session persistence is disabled, and Comet connection tracking is enabled, in context.xml.

I have a servlet that implements CometProcessor. It seems to runs fine. However, at the first time-out event, the following error gets logged:

SEVERE: An exception or error occurred in the container during the request processing
java.lang.NullPointerException
	at org.apache.catalina.connector.CoyoteAdapter.asyncDispatch(CoyoteAdapter.java:270)
	at org.apache.coyote.http11.Http11NioProcessor.asyncDispatch(Http11NioProcessor.java:233)
	at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.event(Http11NioProtocol.java:305)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1526)
	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)

It doesn't seem to happen again after subsequent time-outs from the same session. If one logs in again under another session, the exception happens again after the first time out.
I haven't observed any adverse practical implications. However, I am running this on a machine with very few users and have not tested yet on a full scale.
Comment 1 Mark Thomas 2010-12-12 18:25:32 UTC
I'm having trouble reproducing this. Could you provide a simple test case that demonstrates the issue please.
Comment 2 Miguel Hernandez 2011-01-25 18:03:00 UTC
Created attachment 26550 [details]
A simple test application that presents the error reported.

A similar test case for 7.0.5
Comment 3 Miguel Hernandez 2011-01-25 18:08:01 UTC
I'm having the NPE on exactly the same line of the CoyoteAdapter on 7.0.5. The conditions are slightly different, but its probably related. 

Please follow these instructions:

1. Configure the Http11NioProtocol connector.
2. deploy the attached WAR.
3. open http://localhost:8080/crazed_proxy/
4. click the submit button.

And the NPE will begin to appear.
Comment 4 Mark Thomas 2011-01-28 10:57:33 UTC
Thanks for the test case. I just ran it against the latest 7.0.x and I no longer see the NPE. I recently fixed a bunch of Comet issues with 7.0.x so I suspect that the root cause of this got fixed as part of that.