title: java.net.SocketException in SOAP call
body: <p>I'm looking for an expert's input on this problem.  </p>
  
  <p>I have a java application that connects with remote system via SOAP API. We have this same application (client) running across multiple laptops and hitting various environments (dev, test and production) as required. All is fine except in one laptop in which requests to production (only) fail intermittently. The exception I'm getting is given below:</p>
  
  <pre><code>Mar 14, 2013 10:53:31 AM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
  INFO: Interceptor has thrown exception, unwinding now
  org.apache.cxf.interceptor.Fault: Connection reset
      at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:95)
      at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:466)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:299)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:251)
      at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
      at $Proxy49.fareMasterPricerTravelBoardSearch(Unknown Source)
      at com.ace.amadeus.service.impl.MasterPriceSearchServiceImpl.fareMasterTravelBoardSearch(MasterPriceSearchServiceImpl.java:309)
      at com.ace.amadeus.controller.MasterPricerController.onSubmit(MasterPricerController.java:321)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      at java.lang.Thread.run(Thread.java:722)
  Caused by: com.ctc.wstx.exc.WstxIOException: Connection reset
      at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:313)
      at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:93)
      ... 35 more
  Caused by: java.net.SocketException: Connection reset
      at java.net.SocketInputStream.read(SocketInputStream.java:189)
      at java.net.SocketInputStream.read(SocketInputStream.java:121)
      at sun.security.ssl.InputRecord.readFully(InputRecord.java:312)
      at sun.security.ssl.InputRecord.read(InputRecord.java:350)
      at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:861)
      at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1262)
      at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1289)
      at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1273)
      at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:523)
      at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1087)
      at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1836)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1794)
      at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:42)
      at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69)
      at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:96)
      at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:214)
      at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:311)
      ... 36 more
  
  javax.xml.ws.soap.SOAPFaultException: Connection reset
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:145)
      at $Proxy49.fareMasterPricerTravelBoardSearch(Unknown Source)
      at com.ace.amadeus.service.impl.MasterPriceSearchServiceImpl.fareMasterTravelBoardSearch(MasterPriceSearchServiceImpl.java:309)
      at com.ace.amadeus.controller.MasterPricerController.onSubmit(MasterPricerController.java:321)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
      at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      at java.lang.Thread.run(Thread.java:722)
  Caused by: org.apache.cxf.interceptor.Fault: Connection reset
      at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:95)
      at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:466)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:299)
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:251)
      at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
      ... 28 more
  Caused by: com.ctc.wstx.exc.WstxIOException: Connection reset
      at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:313)
      at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:93)
      ... 35 more
  Caused by: java.net.SocketException: Connection reset
      at java.net.SocketInputStream.read(SocketInputStream.java:189)
      at java.net.SocketInputStream.read(SocketInputStream.java:121)
      at sun.security.ssl.InputRecord.readFully(InputRecord.java:312)
      at sun.security.ssl.InputRecord.read(InputRecord.java:350)
      at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:861)
      at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1262)
      at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1289)
      at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1273)
      at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:523)
      at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
      at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1087)
      at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:1836)
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1794)
      at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:42)
      at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69)
      at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:96)
      at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:214)
      at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:311)
      ... 36 more
  </code></pre>
  
  <p>Do you have any idea what might have happened? To remind you, this happens in only one of many laptops running the same code and config, only in production environment (It's working great in all other environments. There never is any problem), and only at times.  </p>
  
  <p>One more thing: if I make calls using SOAPUI from the same laptop, there's no exception.</p>
  
  <p>Your time and response is very appreciated.  </p>
  
  <p>Thank you.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Additionally, there's one message that keeps popping on this particular laptop only (in eclipse log). I'm not sure this could be a reason though:</p>
  
  <pre><code>Mar 14, 2013 12:19:30 PM org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver handleHttpRequestMethodNotSupported
  WARNING: Request method 'HEAD' not supported
  </code></pre>