tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: NullPointerException is thrown when executing org.apache.coyote.http11.InternalNioOutputBuffer.writeToSocket
Date Tue, 18 Feb 2014 10:30:03 GMT
On 18/02/2014 09:31, HU E wrote:


> PRS0: Http response exception : java.lang.NullPointerException
> org.apache.coyote.http11.InternalNioOutputBuffer.writeToSocket(
> org.apache.coyote.http11.InternalNioOutputBuffer.flushBuffer(
> org.apache.coyote.http11.InternalNioOutputBuffer.endRequest(
> org.apache.coyote.http11.Http11NioProcessor.action(
> org.apache.coyote.Response.action(
> org.apache.coyote.Response.finish(
> org.apache.catalina.connector.OutputBuffer.close(
> org.apache.catalina.connector.CoyoteWriter.close(
> ....
> The tomcat version is 6.0.35.


> So I guess socket is recycled after executing line 460 so that NullPointException is
thrown. But I am not sure why the socket is recycled. Client closes the TCP connection? TCP
write timeout? TCP is reset?

It looks like there might be two threads trying to use the same socket
at the same time - that shouldn't happen.

It might be a Tomcat bug but a  common cause is if the application
retains a reference to the Response, the Writer or the OutputStream
between requests - e.g. in the session or in a Filter.

> I appreciate your help and thanks for your time in advance.

The first thing to do is to carefully check your code for references
being retained across requests that shouldn't be.

Setting the system property
org.apache.catalina.connector.RECYCLE_FACADES to true may help.

For further advice, search the archives for the above system property
and take a look at the related threads.

If you are able to create a repeatable test case then please open a bug
report and provide details of how to recreate this from a clean install
of the latest stable 6.0.x release.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message