Java中Httpcore nio的奇怪例外

时间:2010-03-08 02:09:05

标签: java nio

    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)

2 个答案:

答案 0 :(得分:0)

您使用的NIO Reactor在您尝试使用它时已关闭(连接到它)

请参阅:

java.lang.IllegalStateException: I/O reactor has been shut down

答案 1 :(得分:0)

我查看了代码,我认为NPE正在发生,因为getSession()返回null。