2 keithssy keithssy 于 2014.05.01 21:53 提问

Connection reset by peer: socket write error

这个错误在网上能查到很多结果,但是我参照做都没有效果,现在问题依然存在,详细的错误信息如下

2014-05-01 21:46:37 -close connection error

java.sql.SQLRecoverableException: IO 错误: Connection reset by peer: socket write error
at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:587) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0]
at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:4011) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0]
at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:167) [druid-1.0.0.jar:1.0.0]
at com.alibaba.druid.filter.stat.StatFilter.connection_close(StatFilter.java:254) [druid-1.0.0.jar:1.0.0]
at com.alibaba.druid.filter.FilterChainImpl.connection_close(FilterChainImpl.java:163) [druid-1.0.0.jar:1.0.0]
at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.close(ConnectionProxyImpl.java:115) ~[druid-1.0.0.jar:1.0.0]
at com.alibaba.druid.util.JdbcUtils.close(JdbcUtils.java:82) ~[druid-1.0.0.jar:1.0.0]
at com.alibaba.druid.pool.DruidDataSource.discardConnection(DruidDataSource.java:967) [druid-1.0.0.jar:1.0.0]
at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:934) [druid-1.0.0.jar:1.0.0]
at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4534) [druid-1.0.0.jar:1.0.0]
at com.alibaba.druid.filter.stat.StatFilter.dataSource_getConnection(StatFilter.java:661) [druid-1.0.0.jar:1.0.0]
at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4530) [druid-1.0.0.jar:1.0.0]
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:880) [druid-1.0.0.jar:1.0.0]
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:872) [druid-1.0.0.jar:1.0.0]
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:97) [druid-1.0.0.jar:1.0.0]
at org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource.getConnection(AbstractRoutingDataSource.java:162) [payplat-dacq-1.0-SNAPSHOT.jar:na]
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) [payplat-dacq-1.0-SNAPSHOT.jar:na]
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) [payplat-dacq-1.0-SNAPSHOT.jar:na]
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:382) [payplat-dacq-1.0-SNAPSHOT.jar:na]
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:456) [payplat-dacq-1.0-SNAPSHOT.jar:na]
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:464) [payplat-dacq-1.0-SNAPSHOT.jar:na]
at com.payplat.util.jdbc.other.impl.JdbcServerImpl.meterList(JdbcServerImpl.java:88) [payplat-dacq-1.0-SNAPSHOT.jar:na]
at com.smotive.action.DasControl.meterList(DasControl.java:52) [DasControl.class:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_45]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_45]
at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) [spring-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) [spring-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:920) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:816) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) [servlet-api.jar:na]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:801) [spring-webmvc-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) [servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) [catalina.jar:6.0.35]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.35]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) [spring-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-3.2.1.RELEASE.jar:3.2.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.35]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [catalina.jar:6.0.35]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [catalina.jar:6.0.35]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [catalina.jar:6.0.35]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) [catalina.jar:6.0.35]
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877) [tomcat-coyote.jar:6.0.35]
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594) [tomcat-coyote.jar:6.0.35]
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675) [tomcat-coyote.jar:6.0.35]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
Caused by: java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method) ~[na:1.7.0_45]
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113) ~[na:1.7.0_45]
at java.net.SocketOutputStream.write(SocketOutputStream.java:159) ~[na:1.7.0_45]
at oracle.net.ns.DataPacket.send(DataPacket.java:210) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0]
at oracle.net.ns.NetOutputStream.flush(NetOutputStream.java:230) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0]
at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:321) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0]
at oracle.net.ns.NetInputStream.read(NetInputStream.java:268) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0]
at oracle.net.ns.NetInputStream.read(NetInputStream.java:190) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0]
at oracle.net.ns.NetInputStream.read(NetInputStream.java:107) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0]
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:124) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0]
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:80) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0]
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1137) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0]
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:350) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0]
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0]
at oracle.jdbc.driver.T4C7Ocommoncall.doOLOGOFF(T4C7Ocommoncall.java:61) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0]
at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:574) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0]
... 55 common frames omitted

根据网上的说法,出现的Connection reset by peer: 原因可能是多方面的,不过更常见的原因是:
①:服务器的并发连接数超过了其承载量,服务器会将其中一些连接Down掉;
②:客户关掉了浏览器,而服务器还在给客户端发送数据;
③:浏览器端按了Stop
2、3点可以排除,第一点让我觉得确实有问题,但是不知道该如何下手,还有一个问题就是,这个异常不是我手动捕获的,在我try catch前这个异常已经抛出,这个让我不解

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!