tags:

views:

55

answers:

2
    Exception in thread "Thread-0" java.lang.NullPointerException
 at org.apache.http.impl.nio.reactor.AbstractIOReactor.closeActiveChannels(AbstractIOReactor.java:532)
 at org.apache.http.impl.nio.reactor.AbstractIOReactor.hardShutdown(AbstractIOReactor.java:564)
 at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.doShutdown(AbstractMultiworkerIOReactor.java:411)
 at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:340)
 at com.***.clawer.Clawer$1.run(Clawer.java:81)
 at java.lang.Thread.run(Unknown Source)
    Exception in thread "Thread-1" java.lang.IllegalStateException: I/O reactor has been shut down
 at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.connect(DefaultConnectingIOReactor.java:190)
 at com.***.clawer.Run.run(Run.java:29)
A: 

You're using a NIO Reactor that is closed by the time you try to use it ( connect to it )

See:

java.lang.IllegalStateException: I/O reactor has been shut down
OscarRyz
Possible, but before that, a NullPointerException occurs during doShutdown.
Thilo
I think the worker thread stopped caused this exception, but i do not know why.
bruce dou
@Thilo: Yes, during the shutdown, the method `AbstractIOReactor.closeActiveChannels` tries to close the reactor but it is null because that is already closed. That's the root cause.
OscarRyz
A: 

I had a look at the code, and I think that NPE is happening because getSession() is returning null.

Stephen C