Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3913

NPE in SwitchAjaxExceptionHandlerWrapperImpl

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.15
    • 2.0.22, 2.1.16, 2.2.5
    • None
    • None

    Description

      _isAjaxRequest = facesContext.getPartialViewContext().isAjaxRequest();

      occurs 2 times in SwitchAjaxExceptionHandlerWrapperImpl and facesContext.getPartialViewContext() can be null.
      We should just return false if it's null.

      StackTrace:
      java.lang.NullPointerException
      at org.apache.myfaces.shared.context.SwitchAjaxExceptionHandlerWrapperImpl.isAjaxRequest(SwitchAjaxExceptionHandlerWrapperImpl.java:98)
      at org.apache.myfaces.shared.context.SwitchAjaxExceptionHandlerWrapperImpl.getWrapped(SwitchAjaxExceptionHandlerWrapperImpl.java:106)
      at javax.faces.context.ExceptionHandlerWrapper.isListenerForSource(ExceptionHandlerWrapper.java:70)
      at javax.faces.context.ExceptionHandlerWrapper.isListenerForSource(ExceptionHandlerWrapper.java:70)
      at javax.faces.context.ExceptionHandlerWrapper.isListenerForSource(ExceptionHandlerWrapper.java:70)
      at org.apache.myfaces.application.ApplicationImpl._traverseListenerList(ApplicationImpl.java:2480)
      at org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:586)
      at org.apache.myfaces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:616)
      at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:336)
      at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:336)
      at javax.faces.application.ApplicationWrapper.publishEvent(ApplicationWrapper.java:336)
      at org.apache.deltaspike.jsf.impl.injection.InjectionAwareApplicationWrapper.publishEvent(InjectionAwareApplicationWrapper.java:121)
      at org.apache.myfaces.lifecycle.PhaseListenerManager.publishException(PhaseListenerManager.java:136)
      at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersAfter(PhaseListenerManager.java:123)
      at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:185)
      at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
      at org.apache.deltaspike.jsf.impl.listener.request.DeltaSpikeLifecycleWrapper.execute(DeltaSpikeLifecycleWrapper.java:89)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            tandraschko Thomas Andraschko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: