如何捕获java.io.IOException:已建立的连接被主机中的软件中止?

时间:2015-03-19 07:16:29

标签: java-ee wildfly-8 connection-reset

我调试了这个异常,我观察到当用户向服务器发送一些请求并且在服务器响应用户之前,如果用户关闭浏览器窗口或者只是关闭该特定页面,那么就会发生异常。

2015-03-19 12:04:40 DEBUG io:132 - Error reading request
java.io.IOException: An established connection was aborted by the software in your host machine
    at sun.nio.ch.SocketDispatcher.read0(Native Method)
    at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43)
    at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
    at sun.nio.ch.IOUtil.read(IOUtil.java:192)
    at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)
    at org.xnio.nio.NioSocketConduit.read(NioSocketConduit.java:282)
    at org.xnio.conduits.ConduitStreamSourceChannel.read(ConduitStreamSourceChannel.java:127)
    at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:130)
    at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:108)
    at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:49)
    at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
    at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
    at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:88)
    at org.xnio.nio.WorkerThread.run(WorkerThread.java:539) 

请帮我处理这种类型的异常,因为当此异常发生4到5次时,Server会进入无响应状态。

我的环境是: Application Server:WildFly 8.2.0.Final Java版本:8 JSF版本:2.2

0 个答案:

没有答案