title: JAX-WS RI Metro 2.1.3 - SocketTimeout exception
body: <p>I have developed a web service that is used to upload files on server, it has been created using Metro 2.1 JAX-WS engine and deployed on web sphere 7.0. I can connect to this service and transfer files successfuly but sometimes it throws java.net.SocketTimeoutException: Async operation timed out. </p>
  
  <p>Following is the server stack trace -</p>
  
  <p>It can be because of the bad n/w problem and files getting uploaded are also of reasonable size so we decided to increase the timeout value to 5 mins but i am not able to increase it after trying a lot of code changes. I have tried following methods to increase timeout values but nothing seems to work.</p>
  
  <p>I have tried to set timeout values to '1' to test if timeout happens but web service seemed to be rolling fine without timeouts.</p>
  
  <p>I would appreciate a quick help here.</p>
  
  <p>Thanks,</p>
  
  <pre><code>((BindingProvider)port).getRequestContext().put(BindingProviderProperties.CONNECT_TIMEOUT, 1);
  ((BindingProvider)port).getRequestContext().put(BindingProviderProperties.REQUEST_TIMEOUT, 1);
  </code></pre>
  
  <p>AND</p>
  
  <pre><code>((BindingProvider)port).getRequestContext().put("com.sun.xml.ws.request.timeout", 100); 
  ((BindingProvider)port).getRequestContext().put("com.sun.xml.ws.connect.timeout", 100); 
  </code></pre>
  
  <p>AND </p>
  
  <pre><code>((BindingProvider)port).getRequestContext().put("com.sun.xml.internal.ws.request.timeout", 1); 
  ((BindingProvider)port).getRequestContext().put("com.sun.xml.internal.ws.connect.timeout", 1); 
  </code></pre>
  
  <hr>
  
  <pre>
      java.net.SocketTimeoutException: Async operation timed out
          at com.ibm.ws.tcp.channel.impl.AioTCPReadRequestContextImpl.processSyncReadRequest(AioTCPReadRequestContextImpl.java:189)
          at com.ibm.ws.tcp.channel.impl.TCPReadRequestContextImpl.read(TCPReadRequestContextImpl.java:111)
          at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext.read(SSLReadServiceContext.java:265)
          at com.ibm.ws.http.channel.impl.HttpServiceContextImpl.fillABuffer(HttpServiceContextImpl.java:4142)
          at com.ibm.ws.http.channel.impl.HttpServiceContextImpl.readSingleBlock(HttpServiceContextImpl.java:3374)
          at com.ibm.ws.http.channel.impl.HttpServiceContextImpl.readBodyBuffer(HttpServiceContextImpl.java:3494)
          at com.ibm.ws.http.channel.inbound.impl.HttpInboundServiceContextImpl.getRequestBodyBuffer(HttpInboundServiceContextImpl.java:1705)
          at com.ibm.ws.webcontainer.channel.WCCByteBufferInputStream.bufferIsGood(WCCByteBufferInputStream.java:373)
          at com.ibm.ws.webcontainer.channel.WCCByteBufferInputStream.read(WCCByteBufferInputStream.java:266)
          at com.ibm.ws.webcontainer.srt.http.HttpInputStream.read(HttpInputStream.java:325)
          at org.jvnet.mimepull.MIMEParser.fillBuf(MIMEParser.java:434)
          at org.jvnet.mimepull.MIMEParser.readBody(MIMEParser.java:204)
          at org.jvnet.mimepull.MIMEParser.access$600(MIMEParser.java:62)
          at org.jvnet.mimepull.MIMEParser$MIMEEventIterator.next(MIMEParser.java:154)
          at org.jvnet.mimepull.MIMEParser$MIMEEventIterator.next(MIMEParser.java:123)
          at org.jvnet.mimepull.MIMEMessage.makeProgress(MIMEMessage.java:193)
          at org.jvnet.mimepull.DataHead$ReadMultiStream.fetch(DataHead.java:236)
          at org.jvnet.mimepull.DataHead$ReadMultiStream.read(DataHead.java:207)
          at java.io.InputStream.read(InputStream.java:97)
          at javax.activation.DataHandler.writeTo(DataHandler.java:307)
          at com.ncr.java.service.ValidateRequest.validateCaptureFileContent(ValidateRequest.java:357)
          at com.ncr.java.service.CaptureFileReceiverImpl.uploadCaptureFile(CaptureFileReceiverImpl.java:167)
          at com.ncr.java.service.CaptureFileReceiverImplDelegate.uploadCaptureFile(CaptureFileReceiverImplDelegate.java:46)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
          at java.lang.reflect.Method.invoke(Method.java:611)
          at com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
          at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
          at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
          at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:95)
          at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:629)
          at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:588)
          at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:573)
          at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:470)
          at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:295)
          at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:515)
          at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:285)
          at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:143)
          at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:155)
          at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:189)
          at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:76)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
          at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
          at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:939)
          at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
          at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
          at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
          at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864)
          at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
          at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
          at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
          at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
          at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
          at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
          at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1784)
          at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
          at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
          at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
          at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
          at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
          at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
          at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
          at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)
      Caused by: com.ibm.io.async.AsyncTimeoutException(Async operation timed out, [Timeout, rc=0])
          at com.ibm.io.async.AbstractAsyncFuture.waitForCompletion(AbstractAsyncFuture.java:359)
          at com.ibm.io.async.AsyncFuture.getByteCount(AsyncFuture.java:218)
          at com.ibm.ws.tcp.channel.impl.AioSocketIOChannel.readAIOSync(AioSocketIOChannel.java:215)
          at com.ibm.ws.tcp.channel.impl.AioTCPReadRequestContextImpl.processSyncReadRequest(AioTCPReadRequestContextImpl.java:182)
          ... 64 more
  
      Reporter BEGIN:com.ibm.ws.webcontainer.channel.WCCByteBufferInputStream@447e447e
      java.io.InputStream::SKIP_BUFFER_SIZE:2048
      java.io.InputStream::skipBuffer:null
      com.ibm.ws.webcontainer.channel.WCCByteBufferInputStream::logger:com.ibm.wsspi.webcontainer.logging.WebContainerLogger@2d512d51
      com.ibm.ws.webcontainer.channel.WCCByteBufferInputStream::CLASS_NAME:com.ibm.ws.webcontainer.channel.WCCByteBufferInputStream
      com.ibm.ws.webcontainer.channel.WCCByteBufferInputStream::isc BEGIN:com.ibm.ws.http.channel.inbound.impl.HttpInboundServiceContextImpl@4b574b57
       com.ibm.ws.http.channel.impl.HttpServiceContextImpl::tc BEGIN:com.ibm.ejs.ras.TraceComponent@4b344b34
        com.ibm.ejs.ras.TraceElement::ivLevel:10
        com.ibm.ejs.ras.TraceElement::ivName:com.ibm.ws.http.channel.impl.HttpServiceContextImpl
        com.ibm.ejs.ras.TraceElement::ivDebugEnabled:false
        com.ibm.ejs.ras.TraceElement::ivEventEnabled:false
        com.ibm.ejs.ras.TraceElement::ivEntryEnabled:false
  
  
  </pre>