org.apache.http.nio.reactor.IOReactorException:I / O调度工作程序异常终止

时间:2016-03-17 07:14:13

标签: apache apache-httpasyncclient

我有一个使用apache HttpAsyncClient的服务。 (版本:httpasyncclient-4.0.2.jar,httpcore-4.4.3.jar,httpcore-nio-4.3.3.jar)

启动异步客户端后,所有请求都会在启动失败一段时间后出现初始异常 -

[#| 2016-03-16T22:31:59.376-0700 |严重| glassfish3.1.2 | org.apache.http.impl.nio.client.InternalHttpAsyncClient | _ThreadID = 564; _ThreadName =螺纹-6; | I / O反应器异常终止 org.apache.http.nio.reactor.IOReactorException:I / O调度工作程序异常终止         在org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:357)         at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:189)         at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.doExecute(CloseableHttpAsyncClientBase.java:67)         at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.access $ 000(CloseableHttpAsyncClientBase.java:38)         在org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase $ 1.run(CloseableHttpAsyncClientBase.java:57)         在java.lang.Thread.run(未知来源) 引发者:RestException(statusCode = 500,code = null,message = I / O操作失败,developerMessage = RestException(statusCode = 500,code = null,message = I / O操作失败,developerMessage = null)         at com.notificationservice.analytics.client.AsyncResponse $ 2.failed(AsyncResponse.java:178)         在org.apache.http.concurrent.BasicFuture.failed(BasicFuture.java:134)         at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.failed(DefaultClientExchangeHandlerImpl.java:258)         at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.exception(HttpAsyncRequestExecutor.java:127)         at org.apache.http.impl.nio.client.InternalIODispatch.onException(InternalIODispatch.java:68)         at org.apache.http.impl.nio.client.InternalIODispatch.onException(InternalIODispatch.java:37)         在org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:154)         at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:180)         at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342)         at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:316)         在org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:277)         在org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:105)         at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor $ Worker.run(AbstractMultiworkerIOReactor.java:586)         在java.lang.Thread.run(未知来源) )         at com.notificationservice.client.AsyncResponse $ 2.failed(AsyncResponse.java:178)         在org.apache.http.concurrent.BasicFuture.failed(BasicFuture.java:134)         at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.failed(DefaultClientExchangeHandlerImpl.java:258)         at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.exception(HttpAsyncRequestExecutor.java:127)         at org.apache.http.impl.nio.client.InternalIODispatch.onException(InternalIODispatch.java:68)         at org.apache.http.impl.nio.client.InternalIODispatch.onException(InternalIODispatch.java:37)         在org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:154)         at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:180)         at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:342)         at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:316)         在org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:277)         在org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:105)         at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor $ Worker.run(AbstractMultiworkerIOReactor.java:586)         ......还有1个

新版本会出现同样的问题 - httpasyncclient-4.1.1.jar,httpcore-4.4.4.jar,httpcore-nio-4.4.4.jar

任何见解都将受到高度赞赏。是否有一些需要更改的IOReactorConfig参数?

1 个答案:

答案 0 :(得分:0)

我会说你的休息参数有问题。 StatusCode 500来自服务器,因此您的请求将转到它。

引起:RestException(statusCode = 500,code = null,message = I / O操作失败,developerMessage = RestException(statusCode = 500,code = null,message = I / O操作失败,developerMessage = null