Spring Web Flow
  1. Spring Web Flow
  2. SWF-1383

Spring Faces throws NPE when writing flow state if JSF servlet is called instead of Spring Dispatcher Servlet

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Complete
    • Affects Version/s: 2.2.0.M1
    • Fix Version/s: 2.2.0.RC1
    • Component/s: JSF
    • Labels:
      None

      Description

      Response writer is interrupted and the page up until, but not including the closing </h:form> tag is rendered, along with an error that extra content was found at the end of the document.

      The following is from the server log, pinpointing the error.

      It seems like Faces doesn't double check to make sure SWF is actually being called, then tries to write out the null SWF state to the form, causing this exception, and rendering the Faces Servlet useless if run directly.

      WARNING: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
      java.lang.NullPointerException
              at org.springframework.faces.webflow.FlowViewResponseStateManager.writeState(FlowViewResponseStateManager.java:84)
              at com.sun.faces.application.StateManagerImpl.writeState(StateManagerImpl.java:155)
              at org.springframework.faces.webflow.FlowViewStateManager.writeState(FlowViewStateManager.java:114)
              at com.sun.faces.application.view.WriteBehindStateWriter.flushToWriter(WriteBehindStateWriter.java:221)
              at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:397)
              at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
              at org.springframework.faces.webflow.FlowViewHandler.renderView(FlowViewHandler.java:99)
              at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
              at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
              at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
              at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
              at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
              at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
              at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
              at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
              at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
              at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
              at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
              at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
              at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
              at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
              at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
              at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
              at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
              at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
              at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
              at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
              at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
              at java.lang.Thread.run(Thread.java:637)

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Rossen Stoyanchev
            Reporter:
            Charles Chappell
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development