3 Replies Latest reply on Apr 26, 2007 3:29 AM by Scott McNab

    socket write error with Seam Remoting

    Scott McNab Newbie

      I have recently migrated from JBossAS 4.0.4.GA/Seam 1.0.1.GA to JBossAS 4.2.0.CR1/Seam 1.2.0.PATCH1 and am getting a new exception.

      My web interface uses Seam.Remoting.subscribe() to asynchronously subscribe to JMS messages. This functionality is working correctly, however if I navigate away from the page, I get the following server exception after a short period of time:

      2007-03-16 15:19:58,437 484812 ERROR [org.jboss.seam.remoting.Remoting] (http-192.168.100.27-80-2:) Error
      ClientAbortException: java.net.SocketException: Software caused connection abort: socket write error
       at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:358)
       at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:434)
       at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:309)
       at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:288)
       at org.apache.catalina.connector.CoyoteOutputStream.flush(CoyoteOutputStream.java:98)
       at org.jboss.seam.remoting.PollHandler.marshalResponse(PollHandler.java:159)
       at org.jboss.seam.remoting.PollHandler.handle(PollHandler.java:94)
       at org.jboss.seam.remoting.Remoting.getResource(Remoting.java:110)
       at org.jboss.seam.servlet.ResourceServlet.doPost(ResourceServlet.java:76)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:87)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn.invoke(ClusteredSingleSignOn.java:676)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.net.SocketException: Software caused connection abort: socket write error
       at java.net.SocketOutputStream.socketWrite0(Native Method)
       at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
       at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
       at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:764)
       at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:124)
       at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:570)
       at org.apache.coyote.Response.doWrite(Response.java:560)
       at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:353)
       ... 44 more
      


      I think it might have something to do with the server trying to respond to an old browser long-poll request that has since been terminated on the client side (i.e when the user navigates to another page)?

      This same code used to work fine with Seam 1.0.1.GA however. Any ideas what is causing this?

      Thanks,
      Scott

        • 1. Re: socket write error with Seam Remoting
          Scott McNab Newbie

          I have upgraded to Seam 1.2.1.GA and still get this exception, however I have discovered that it appears to only happens when running the server on Windows XP.

          For some reason, running the same application with JBoss on Linux does NOT give this "socket write error" exception.

          Could this perhaps be something to do with different socket handling behaviour of Tomcat 6 under Windows?

          I think it might have something to do with the server trying to respond to an old browser long-poll request that has since been terminated on the client side (i.e when the user navigates to another page)?

          I am 100% certain this is the cause - the exception occurs consistently approximately 30 seconds after I navigate away from a Seam page containing an active Seam.Remoting.subscribe() call. (30 seconds is my Seam remoting poll-timeout value).

          My guess is that when the AJAX long-poll expires, the server attempts to write a response (e.g. no messages on JMS topic) but fails with an exception because the client is no longer listening to the request (having since moved on to a new page).

          Does anyone know how to fix this? The exception appears benign, however it is causing false alerts in my error log and it is frustrating that it happens under Windows and not Linux.

          • 2. Re: socket write error with Seam Remoting
            Shane Bryzak Master

            Please raise this in JIRA.