问题描述
- socket连接,偶尔发生这个异常,是什么原因引起的?
-
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:196)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at java.net.SocketInputStream.read(SocketInputStream.java:108)
at com.reapal.bipgw.biz.abc.util.Messenger2.sendBySoc(Messenger2.java:52)
at com.reapal.bipgw.biz.abc.service.impl.AbcClientServiceImpl.sendReq(AbcClientServiceImpl.java:337)
at com.reapal.bipgw.biz.abc.service.impl.AbcClientServiceImpl.isExist(AbcClientServiceImpl.java:197)
at com.reapal.bipgw.biz.abc.service.impl.AbcClientServiceImpl.multiPay(AbcClientServiceImpl.java:82)
at com.reapal.bipgw.web.controller.AbcController.multipay(AbcController.java:69)
at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
这个异常不是一直发生,时好时坏,发送的报文在格式上应该不会存在问题.
解决方案
socketerrorcode:11001,socketerrorinfo:不知道这样的主机。
表示您的计算机无法连上服务器,请检查您的Proxy设定以及Proxy相关账号,或暂时取消您防毒软件的「个人防火墙」。
2、出现网络联机错误Socketerror#11004
socketerrorcode:11004,socketerrorinfo:请求的名称有效,但是找不到请求的类型的数据。
应该是网络联机状态问题,请用户检查网络联机是否正常。
3、出现网络联机错误Socketerror#10060 Connection Timed Out
socketerrorcode:10060,socketerrorinfo:由于连接方在一段时间后没有正确答复或连接的主机没有反应,连接尝试失败。
表示您与服务器发生联机逾时错误,请检查您的Proxy相关设定,以及Proxy Server是否已将SSL 443 port打开。
4、出现网络联机错误Socketerror#10061
socketerrorcode:10061,socketerrorinfo:由于目标计算机积极拒绝,无法连接。
解决方案二:
还是不太懂,仍然谢谢您!
解决方案三:
客户端或者服务器端其中一端关闭了连接 另一端未关闭连接并任然在进行读写操作 则会报该异常
时间: 2024-11-08 22:21:54