1 Reply Latest reply on Jul 30, 2014 10:29 AM by Philippe Starboard

    Failed executing POST - ClientAbortException: java.io.IOException: Socket read failed

    montia Newbie

      I am running JBoss 7.1.1.Final behind Apache 2.2 with mod_cluster-1.2.0.Final. I have a RESTEasy web service that is accessed over HTTPS from the same user session via repeated successive GET and POST requests to the same resource using jQuery.ajax().

       

      The user logs into the application and goes through a series of questions where the answer to the current question determines the question that will be displayed next. The question to be displayed is acquired via a GET request to the test/question resource. The answer selected by the user is sent along with other data to the server as a JSON string via a POST request on the same resource when the user clicks a button.

       

      About 1% of the time, when trying to send a POST request nothing happens on the client for exactly 5 minutes. After 5 minutes the error handler of the ajax() call indicates a Bad Request status code. We've noticed this behaviour only from IE8 and IE9. I have not noticed it at all when testing locally directly against the JBoss server.

       

      After the 5 minutes, the following line is added to the Apache ssl access log:

      "POST /myApp/rest/test/question HTTP/1.1" 400 226

       

      And the following error is logged in the JBoss server.log:

      SEVERE [org.jboss.resteasy.core.SynchronousDispatcher] (ajp--127.0.0.1-8009-5) Failed executing POST /myApp/test/question: org.jboss.resteasy.spi.ReaderException: ClientAbortException:  java.io.IOException: Socket read failed
      at org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:202) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.core.MethodInjectorImpl.injectArguments(MethodInjectorImpl.java:124) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:147) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.2.Final.jar:]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
      at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
      at org.myapp.util.JSONPRequestFilter.doFilter(JSONPRequestFilter.java:77) [classes:]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
      at org.myapp.security.Authenticator.doFilter(Authenticator.java:59) [classes:]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
      at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.event(JBossWebContext.java:67)
      at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.invoke(JBossWebContext.java:48)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489) [jbossweb-7.0.13.Final.jar:]
      at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
      at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:505) [jbossweb-7.0.13.Final.jar:]
      at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:445) [jbossweb-7.0.13.Final.jar:]
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_32]
      Caused by: ClientAbortException:  java.io.IOException: Socket read failed
      at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:357) [jbossweb-7.0.13.Final.jar:]
      at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:420) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:379) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:193) [jbossweb-7.0.13.Final.jar:]
      at org.codehaus.jackson.impl.ByteSourceBootstrapper.ensureLoaded(ByteSourceBootstrapper.java:507) [jackson-core-asl-1.9.2.jar:1.9.2]
      at org.codehaus.jackson.impl.ByteSourceBootstrapper.detectEncoding(ByteSourceBootstrapper.java:129) [jackson-core-asl-1.9.2.jar:1.9.2]
      at org.codehaus.jackson.impl.ByteSourceBootstrapper.constructParser(ByteSourceBootstrapper.java:224) [jackson-core-asl-1.9.2.jar:1.9.2]
      at org.codehaus.jackson.JsonFactory._createJsonParser(JsonFactory.java:785) [jackson-core-asl-1.9.2.jar:1.9.2]
      at org.codehaus.jackson.JsonFactory.createJsonParser(JsonFactory.java:561) [jackson-core-asl-1.9.2.jar:1.9.2]
      at org.codehaus.jackson.jaxrs.JacksonJsonProvider.readFrom(JacksonJsonProvider.java:414)
      at org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl.proceed(MessageBodyReaderContextImpl.java:105) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.read(GZIPDecodingInterceptor.java:61) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.core.interception.MessageBodyReaderContextImpl.proceed(MessageBodyReaderContextImpl.java:108) [resteasy-jaxrs-2.3.2.Final.jar:]
      at org.jboss.resteasy.core.MessageBodyParameterInjector.inject(MessageBodyParameterInjector.java:169) [resteasy-jaxrs-2.3.2.Final.jar:]
      ... 38 more
      Caused by: java.io.IOException: Socket read failed
      at org.apache.coyote.ajp.AjpProcessor.read(AjpProcessor.java:1135) [jbossweb-7.0.13.Final.jar:]
      at org.apache.coyote.ajp.AjpProcessor.readMessage(AjpProcessor.java:1213) [jbossweb-7.0.13.Final.jar:]
      at org.apache.coyote.ajp.AjpProcessor.receive(AjpProcessor.java:1152) [jbossweb-7.0.13.Final.jar:]
      at org.apache.coyote.ajp.AjpProcessor$SocketInputBuffer.doRead(AjpProcessor.java:1278) [jbossweb-7.0.13.Final.jar:]
      at org.apache.coyote.Request.doRead(Request.java:438) [jbossweb-7.0.13.Final.jar:]
      at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:347) [jbossweb-7.0.13.Final.jar:]
      ... 51 more

       

      The request goes through an authentication filter and then a second filter. In both instances, the request just gets passed along using chain.doFilter(ServletRequest, ServletResponse). Based on my debugging, the request makes it past the filters fine, but never makes it inside updateTestQuestion(), the method in the web service that handles the POST request:

       

      @POST
      @Path("/question")
      @Consumes(MediaType.APPLICATION_JSON)
      @Produces(MediaType.APPLICATION_JSON)
      public Response updateTestQuestion(@Context UriInfo uriInfo, TestQuestion curTestQuestion)

       

      - where TestQuestion is a JavaBean with several properties and getter and setter methods:

       

      @XmlRootElement
      public class TestQuestion implements Serializable {

       

      }

       

      I am trying to find out what could be causing this or how I can debug it better. At this point I think there is some kind of breakdown in the client-server communication, but I do not know at which end and how to detect it.

       

      Thank you,

      Monica