title: EXCEPTION :Async operation timed out - When reading input stream in servlet
body: <p>I got the exception <code>EXCEPTION  :Async operation timed out</code> when reading input stream in servlet.<br>
  Code for read input stream is :  </p>
  
  <pre><code>        ServletInputStream rdata = request.getInputStream();
          int contentLength = request.getContentLength()!=-1?request.getContentLength():0;
          byte[] ar_byte = new byte[contentLength];
          rdata.read(ar_byte, 0, request.getContentLength());
          json_str =  new String(ar_byte, "UTF-8");  
  </code></pre>
  
  <p>I got exception at line<br>
  <code>rdata.read(...</code><br>
   when my application is running in <code>WebSphere 6.1</code> but i didnt get when it is running in <code>Tomcat 6.0</code>  </p>
  
  <p>StackTrace for Exception is :  </p>
  
  <pre><code>java.net.SocketTimeoutException: Async operation timed out
  at com.ibm.ws.tcp.channel.impl.AioTCPReadRequestContextImpl.processSyncReadRequest(AioTCPReadRequestContextImpl.java:157)
  at com.ibm.ws.tcp.channel.impl.TCPReadRequestContextImpl.read(TCPReadRequestContextImpl.java:109)
  at com.ibm.ws.http.channel.impl.HttpServiceContextImpl.fillABuffer(HttpServiceContextImpl.java:4130)
  at com.ibm.ws.http.channel.impl.HttpServiceContextImpl.readSingleBlock(HttpServiceContextImpl.java:3374)
  at com.ibm.ws.http.channel.impl.HttpServiceContextImpl.readBodyBuffer(HttpServiceContextImpl.java:3479)
  at com.ibm.ws.http.channel.inbound.impl.HttpInboundServiceContextImpl.getRequestBodyBuffer(HttpInboundServiceContextImpl.java:1604)
  at com.ibm.ws.webcontainer.channel.WCCByteBufferInputStream.bufferIsGood(WCCByteBufferInputStream.java:235)
  at com.ibm.ws.webcontainer.channel.WCCByteBufferInputStream.read(WCCByteBufferInputStream.java:153)
  at com.ibm.ws.webcontainer.srt.http.HttpInputStream.read(HttpInputStream.java:308)
  at servlet.AppServlet.doPost(AppServlet.java:226)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
  at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1213)
  at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:658)
  at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:526)
  at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
  at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:764)
  at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1478)
  at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:133)
  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:457)
  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:300)
  at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
  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:136)
  at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:196)
  at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:751)
  at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:881)
  at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1551)
  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:216)
  at com.ibm.ws.tcp.channel.impl.AioSocketIOChannel.readAIOSync(AioSocketIOChannel.java:214)
  at com.ibm.ws.tcp.channel.impl.AioTCPReadRequestContextImpl.processSyncReadRequest(AioTCPReadRequestContextImpl.java:150)
  ... 30 more  
  </code></pre>
  
  <p>Can any one give suggestion to solve this issue.</p>
  
  <p>Thanks in advance.</p>