Uploaded image for project: 'Spring Web Flow'
  1. Spring Web Flow
  2. SWF-1544

JSF Composite Component causes NPE during deserialization

    XMLWordPrintable

    Details

      Description

      Steps to reproduce (or apply attached patch to issue project SWF-1468)

      1. Create composite component that contains a composite:insertFacet or composite:insertChildren
      2. Create a flow with one view-state
      3. Create a view that uses the composite component
      4. Run the application and load the page
      5. Reload the page twice (in the same flow state)

      The NPE is thrown during unmarshaling the flow snapshot. Mojarra's Resource implementation tries to obtain a ResourceManager from the current FacesContext. The FacesContext, however, has not been set at this point since FlowFacesContextListener would get notified after a the snapshot is restored.

      This issue has already been reported for version 2.2.1 but SWF-1468 has been set to "Resolved" as of inability to reproduce.

      Stacktrace
      java.lang.NullPointerException
      	at com.sun.faces.application.resource.ResourceImpl.readExternal(ResourceImpl.java:415)
      	at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1791)
      	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)
      	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
      	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1946)
      	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1870)
      	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
      	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
      	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
      	at java.util.ArrayList.readObject(ArrayList.java:593)
              ...
      	at org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshot.deserialize(SerializedFlowExecutionSnapshot.java:194)
      	at org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshot.unmarshal(SerializedFlowExecutionSnapshot.java:99)
      	at org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshotFactory.restoreExecution(SerializedFlowExecutionSnapshotFactory.java:80)
      	at org.springframework.webflow.execution.repository.snapshot.AbstractSnapshottingFlowExecutionRepository.restoreFlowExecution(AbstractSnapshottingFlowExecutionRepository.java:89)
      	at org.springframework.webflow.execution.repository.impl.DefaultFlowExecutionRepository.getFlowExecution(DefaultFlowExecutionRepository.java:115)
      	at org.springframework.webflow.executor.FlowExecutorImpl.resumeExecution(FlowExecutorImpl.java:168)
      	at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:183)
      	at org.springframework.faces.webflow.JsfFlowHandlerAdapter.handle(JsfFlowHandlerAdapter.java:48)
      	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
      	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)
      	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
      	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
              ...
      

        Attachments

          Activity

            People

            Assignee:
            rstoya05-aop Rossen Stoyanchev
            Reporter:
            pelzrutsche Pelz Rutsche
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: