MDA/MDD/TDD/DDD/DDDDDDD
posts - 536, comments - 111, trackbacks - 0, articles - 0
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理
  extremetable导出excel,弹出一个下载窗口,这时不点下载而点取消,则报下面的异常:
ClientAbortException 
Caused by: java.net.SocketException: Connection reset by peer: socket write error

查了下TOMCAT的文档,解释如下:
Wrap an IOException identifying it as being caused by an abort of a request by a remote client.
在BAIDU和GOOGLE上找了下原因,大概归结为:
ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error的原因是由于处理http连接时,正在输出内容时,用户关闭了IE,会出现一个"ClientAbortException",属于I/O处理中出现的一个异常,应用服务器应该会捕捉。
Connection reset by peer的原因:
经常出现的Connection reset by peer: 原因可能是多方面的,不过更常见的原因是:
①:服务器的并发连接数超过了其承载量,服务器会将其中一些连接Down掉;
②:客户关掉了浏览器,而服务器还在给客户端发送数据;
③:浏览器端按了Stop
很多人都说是客户端造成的,没有办法控制,是个比较郁闷的问题。

但是,我担心的是:虽然前台没有任何出错的迹象,但是后台会记录这个异常,日志也会疯狂爆满,时间长了,肯定会DOWN掉的,还没找到好的解决办法
resin有一个参数ignore-client-disconnect
tomcat似乎没有


经常出现的Connection reset by peer: 原因可能是多方面的,不过更常见的原因是:①:服务器的并发连接数超过了其承载量,服务器会将其中一些连接Down掉;②:客户关掉了浏览器,而服务器还 在给客户端发送数据;③:浏览器端按了Stop

[10054] Connection reset by peer
  Connection reset by peer is a tough one because it can be caused by so many things. In all cases, the server determines that the socket is no longer good and closes it from its side.
  Read Error
  Scenario: Mary couldn't make out what Joe was saying anymore, so she hung up rather than lose his messages (data).
  A read error occurs when a server cannot successfully read from a user's client. Servers gather information from the client by text, setup, and other items.When the server receives an error when reading from a client, it then disconnects the user, resulting in a read error quit message.
  Write Error
  Scenario: Mary was trying to talk to Joe but didn't think she was getting through, so she hung rather than lose his messages (data).
  A write error occurs when a server cannot successfully write to a user's client. When the server receives information, it usually responds with information of its own. When the server receives an error when writing to a client, it then disconnects the user, resulting in a write error quit message similar to the read error format.
  Ping Timeout Error
  Scenario: Mary, having been raised in a household with too many kids and always craving attention, keeps asking to make sure that Joe is still on the line and listening. If he doesn't reply fast enough to suit her, she hangs up.
   Servers automatically ping users at a preset time. The reason for this is to ensure the client is still connected to the server. When you see "PING? PONG!" results in your status window, it means the server has pinged your client, and it has responded back with a pong to ensure the server that you are still connected. When this does not happen and you disconnect without the server's knowledge, the server will automatically disconnect the user when it does not receive a response, resulting in a ping timeout. Ping timeouts occur to EVERYONE.
  Broken pipe Error
   Scenario: Mary had picked up a sticky note with a message she needed to relay to Joe, but somehow between her hand and her mouth, the message got misplaced. Mary was trying to talk to Joe but didn't think she was getting through, so she hung up rather than lose his messages (data).
   A broken pipe error occurs when the server knows it has a message but can't seem to use its internal data link to get the data out to the socket.
  Miscellaneous
  Scenario: Lots of other reasons; perhaps the operator broke in and gave Mary a message that made her doubt the validity of the call so she hung up


评论

# re: ClientAbortException,Connection reset by peer: socket write error (摘自javaeye)  回复  更多评论   

2007-09-21 19:31 by 345
我碰到的情况是用js跳就包错
直接写就好了

# re: ClientAbortException,Connection reset by peer: socket write error (摘自javaeye)  回复  更多评论   

2007-11-17 17:32 by aaaaaaaaa
我今天下午也遇到了这样一个问题
头痛我了我一个下午该怎么解决呢

# re: ClientAbortException,Connection reset by peer: socket write error (摘自javaeye)  回复  更多评论   

2008-12-01 15:19 by
我也碰到这个问题了,不知道怎么解决。

# re: ClientAbortException,Connection reset by peer: socket write error (摘自javaeye)  回复  更多评论   

2009-10-16 14:47 by shanfeng1
我也有相关问题,间歇性报错

# re: ClientAbortException,Connection reset by peer: socket write error (摘自javaeye)  回复  更多评论   

2012-02-22 10:51 by 竹兰情结
我也碰到了这个问题,发现这个与浏览器有关系,360报错,IE,火狐不会报错!

只有注册用户登录后才能发表评论。


网站导航: