Hi,

We are using HTTP-NIO 4.0 to communicate with our internal http servers, on a 
very high volume bases (80Mbits/second on both upload and download). We use 
AsyncNHttpClientHandler and DefaultClientIOEventDispatch. 


We are seeing some strange behaviors randomly. After putting some debug 
messages and we finally identify the following exception that causes us great 
sorrow:


java.lang.NullPointerException
        at 
org.apache.http.nio.protocol.AsyncNHttpClientHandler.outputReady(AsyncNHttpClientHandler.java:266)
        at 
org.apache.http.impl.nio.DefaultNHttpClientConnection.produceOutput(DefaultNHttpClientConnection.java:213)
        at 
org.apache.http.impl.nio.DefaultClientIOEventDispatch.outputReady(DefaultClientIOEventDispatch.java:152)
        at 
org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:177)
        at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:317)
        at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:294)
        at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:256)
        at 
org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:96)
        at 
org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:556)
        at 
java.lang.Thread.run(Thread.java:619)

It happens randomly and happens with HTTP GET. Look at the line 266, it is:

int statusCode = response.getStatusLine().getStatusCode();

It seems that the "response" is returned prematurely. 


This NullPointerException will propagate all the way up to 
IOReactorExceptionHandler "handle(RuntimeException ex);", where you only have 
two options, ignore it or shutdown the whole IoReactor (neither of the two is 
good for us). I guess the root problem is that we should never see that NPE. 


Is there any more information I can provide to help address this problem?

thanks,
Yong


      

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to