2 Replies Latest reply on Sep 11, 2012 2:33 AM by infoni

    Error in server logs when an ajax request is aborted during transfer

    infoni

      Hi,

       

      When a user cancels a running ajax resource, for example:

      - by closing his web browser/tab when the resource is being transfered

      - by closing his tab browser when the resource is being transfered

      - by refreshing the page when the resource is being transfered

      - if a portlet code use the javascript method .abort() on a client-side user action, when the resource is being transfered

       

      then an Exception is logged as error on server side:

       

      Sep 7, 2012 2:42:39 PM org.exoplatform.portal.webui.application.UIPortletActionListener$ServeResourceActionListener execute

      SEVERE: Problem while serving resource renderingURL for the portlet: local._dumbvalue

      ClientAbortException:  java.net.SocketException: Software caused connection abort: socket write error

                at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:373)

                at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:437)

                at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:351)

                at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:396)

                at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:385)

      ....

       

      I think this exception should be caught in org.exoplatform.portal.webui.application.UIPortletActionListener$ServeResourceActionListener$ServeResourceActionListener,

      because it does not appear to be really an error and is very annoying for administrators when they inspect server logs.

       

      By looking at the  ServeResourceActionListener code, here is where this error is logged:

       

      358         catch (Exception e)

      359         {

      360            log.error("Problem while serving resource for the portlet: " + uiPortlet.getPortletContext().getId(), e);

      361         }

       

      For example, may be this exception could be logged at a finest level, but not as error or warning?

       

              catch(SocketException e){

                          log.fine("Problem while transfering resource for the portlet, probably due to a client-side abort: " + uiPortlet.getPortletContext().getId(), e);

               }

              catch (Exception e)

               {

                  log.error("Problem while serving resource for the portlet: " + uiPortlet.getPortletContext().getId(), e);

               }

       

      What do you think about this enhancement?

       

      Thanks!