我们有一个应用程序,我们正在进行异步请求以获取Servlet响应。对于异步请求我们正在使用apache nio
https://hc.apache.org/httpcomponents-core-ga/tutorial/html/nio.html
我收到此错误。此错误并非始终发生,我无法确定何时发生此错误。
最初我认为问题出在游泳池和增加游泳池大小。 但有时只有在发送单个请求时才会出现,尽管池大小为1000。
可能导致此错误的原因如下所示:
java.net.ConnectException: null
at org.apache.http.nio.pool.RouteSpecificPool.timeout(RouteSpecificPool.java:170) [httpcore-nio-4.4.4.jar:4.4.4]
at org.apache.http.nio.pool.AbstractNIOConnPool.requestTimeout(AbstractNIOConnPool.java:560) [httpcore-nio-4.4.4.jar:4.4.4]
at org.apache.http.nio.pool.AbstractNIOConnPool$InternalSessionRequestCallback.timeout(AbstractNIOConnPool.java:821) [httpcore-nio-4.4.4.jar:4.4.4]
at org.apache.http.impl.nio.reactor.SessionRequestImpl.timeout(SessionRequestImpl.java:182) [httpcore-nio-4.4.4.jar:4.4.4]
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processTimeouts(DefaultConnectingIOReactor.java:212) [httpcore-nio-4.4.4.jar:4.4.4]
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:157) [httpcore-nio-4.4.4.jar:4.4.4]
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:350) [httpcore-nio-4.4.4.jar:4.4.4]
at com.sampleApp.test.nio.NotifierReactor$2.run(NotifierReactor.java:93) [classes/:na]