Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-4240

Fix errors when redirecting to error page when response is already commited

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.3 RC
    • Fix Version/s: 5.3 GA
    • Component/s: None

      Description

      Some errors persist in excpetion handling mechanism (see NXP-3428), when mock faces context created for error handling is not properly removed from current context.
      For instance:

      1. exception hadling catches an error, for instance:

      Caused by: ClientAbortException: java.net.SocketException: Connection reset
      at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:358)

      2. error is handled correctly and put in nuxeo-error.log : [org.nuxeo.ecm.webapp.shield.SeamExceptionHandlingListener] Created mock faces context for exception handling

      3. Response is already commited => ERROR [org.nuxeo.ecm.platform.web.common.exceptionhandling.DefaultNuxeoExceptionHandler] Cannot forward to error page: response is already commited

      4. mock faces context created previously is not cleant up correctly => we get additional errors like:

      javax.servlet.ServletException: org.apache.jasper.JasperException: An exception occurred processing JSP page /login.jsp at line 206
      ...
      Caused by: java.lang.UnsupportedOperationException
      at org.jboss.seam.mock.MockApplication.getELContextListeners(MockApplication.java:93)
      at com.sun.faces.el.ELContextListenerImpl.contextCreated(ELContextListenerImpl.java:70)
      ...
      java.lang.NullPointerException
      at org.apache.catalina.connector.Request.removeAttribute(Request.java:1354)
      at org.apache.catalina.connector.RequestFacade.removeAttribute(RequestFacade.java:514)
      at org.jboss.seam.mock.MockExternalContext$2.removeAttribute(MockExternalContext.java:274)
      at org.jboss.seam.mock.MockExternalContext$AttributeMap.remove(MockExternalContext.java:471)
      at org.jboss.seam.contexts.BasicContext.remove(BasicContext.java:73)
      at org.jboss.seam.Component.newInstance(Component.java:2070)

      => need to cleanup the mock faces context in any case.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: