0 Replies Latest reply on Jan 8, 2010 5:07 AM by Sanjeev Sharma

    java.net.SocketTimeoutException: Read timed out

    Sanjeev Sharma Newbie
      The problem we are facing is as below We are using Jboss 4.2 as our application server and oracle as database.The problem which I am mentioning is happening only from few locations. When we send raw image from applet to our servlet the size of raw image is around 84 k and the Jboss server throws following error. 2009-12-18 16:25:45,284 ERROR [STDERR] java.net.SocketTimeoutException: Read timed out2009-12-18 16:25:45,284 ERROR [STDERR]              at java.net.SocketInputStream.socketRead0(Native Method)2009-12-18 16:25:45,284 ERROR [STDERR]              at java.net.SocketInputStream.read(SocketInputStream.java:129)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:716)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:746)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:116)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:675)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.coyote.Request.doRead(Request.java:428)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:297)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:405)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:312)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:193)2009-12-18 16:25:45,284 ERROR [STDERR]              at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2264)2009-12-18 16:25:45,284 ERROR [STDERR]              at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2277)2009-12-18 16:25:45,284 ERROR [STDERR]              at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2748)2009-12-18 16:25:45,284 ERROR [STDERR]              at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:780)2009-12-18 16:25:45,284 ERROR [STDERR]              at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)2009-12-18 16:25:45,284 ERROR [STDERR]              at register.servlet.VerifyDBImagesServlet.doPost(VerifyDBImagesServlet.java:38)2009-12-18 16:25:45,284 ERROR [STDERR]              at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)2009-12-18 16:25:45,284 ERROR [STDERR]              at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)2009-12-18 16:25:45,284 ERROR [STDERR]              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)2009-12-18 16:25:45,284 ERROR [STDERR]              at java.lang.Thread.run(Thread.java:619)2009-12-18 16:27:08,312 INFO  [STDOUT] VerifyDBImagesServlet.doPost() 1-- Fri Dec 18 16:27:08 GMT+03:00 20092009-12-18 16:27:16,234 DEBUG [com.arjuna.ats.arjuna.logging.arjLogger] Periodic recovery - first pass <Fri, 18 Dec 2009 16:27:16>2009-12-18 16:27:16,234 DEBUG [com.arjuna.ats.arjuna.logging.arjLogger] StatusModule: first pass 2009-12-18 16:27:16,234 DEBUG [com.arjuna.ats.txoj.logging.txojLoggerI18N] [com.arjuna.ats.internal.txoj.recovery.TORecoveryModule_3] - TORecoveryModule - first pass2009-12-18 16:27:16,234 DEBUG [com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.recovery.info.firstpass] Local XARecoveryModule - first pass2009-12-18 16:27:26,234 DEBUG [com.arjuna.ats.arjuna.logging.arjLogger] Periodic recovery - second pass <Fri, 18 Dec 2009 16:27:26>2009-12-18 16:27:26,234 DEBUG [com.arjuna.ats.arjuna.logging.arjLogger] AtomicActionRecoveryModule: Second pass 2009-12-18 16:27:26,234 DEBUG [com.arjuna.ats.txoj.logging.txojLoggerI18N] [com.arjuna.ats.internal.txoj.recovery.TORecoveryModule_6] - TORecoveryModule - second pass2009-12-18 16:27:26,234 DEBUG [com.arjuna.ats.jta.logging.loggerI18N] [com.arjuna.ats.internal.jta.recovery.info.secondpass] Local XARecoveryModule - second pass2009-12-18 16:27:28,843 ERROR [STDERR] java.net.SocketTimeoutException: Read timed out2009-12-18 16:27:28,843 ERROR [STDERR]              at java.net.SocketInputStream.socketRead0(Native Method)2009-12-18 16:27:28,843 ERROR [STDERR]              at java.net.SocketInputStream.read(SocketInputStream.java:129)2009-12-18 16:27:28,843 ERROR [STDERR]              at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:716)2009-12-18 16:27:28,843 ERROR [STDERR]              at org.apache.coyote.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:746)2009-12-18 16:27:28,843 ERROR [STDERR]              at org.apache.coyote.http11.filters.IdentityInputFilter.doRead(IdentityInputFilter.java:116)2009-12-18 16:27:28,843 ERROR [STDERR]              at org.apache.coyote.http11.InternalInputBuffer.doRead(InternalInputBuffer.java:675)2009-12-18 16:27:28,843 ERROR [STDERR]              at org.apache.coyote.Request.doRead(Request.java:428)2009-12-18 16:27:28,843 ERROR [STDERR]              at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:297)2009-12-18 16:27:28,843 ERROR [STDERR]              at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:405)2009-12-18 16:27:28,843 ERROR [STDERR]              at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:312)2009-12-18 16:27:28,843 ERROR [STDERR]              at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:193)2009-12-18 16:27:28,843 ERROR [STDERR]              at java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2264)2009-12-18 16:27:28,843 ERROR [STDERR]              at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2277)2009-12-18 16:27:28,843 ERROR [STDERR]              at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2748)2009-12-18 16:27:28,843 ERROR [STDERR]              at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:780)2009-12-18 16:27:28,843 ERROR [STDERR]              at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280)                                                                The code at applet is URLConnection con = getServletConnection("verifyDB");                                                                     OutputStream outstream = con.getOutputStream();                                                                                                     ObjectOutputStream oos = new ObjectOutputStreamtstream);                                                                                                                               sendObject[0] = (Object) capturedImage;                                                                sendObject[1] = capturePosition;                                                                sendObject[2] = (Integer) imageWidth;                                                                sendObject[3] = (Integer) imageHeight;                                                                sendObject[4] = (Integer) imageDPI;                                                                                                                                oos.writeObject(sendObject);                                                                oos.flush();                                                                oos.close(); And the code at servlet is response.setContentType("application/x-java-serialized-object");                                                                                                 InputStream in = request.getInputStream();                                                ObjectInputStream inputFromApplet = new ObjectInputStream(in);                                                Object[] appletInput = (Object[]) inputFromApplet.readObject();

       

      We reduced the size of raw image to 30k but still this problem exist from few locations.