5 Replies Latest reply on Mar 26, 2007 7:29 PM by Andrew

    Getting a NullPointerException in Seam ConversationEntry wit

    Andrew Apprentice

      I have been using Seam 1.1.6 for a while now with no issues until I just started using Ajax4Jsf 1.1.0. When the user's session has timed out, I keep getting a NullPointerException with an AJAX request when the AjaxViewRoot attempts to redirect the user. The exception is due to the conversation stack not being properly initialized in JBoss Seam.

      Here is the stack:

      java.lang.NullPointerException
       at org.jboss.seam.core.ConversationEntry.<init>(ConversationEntry.java:44)
       at org.jboss.seam.core.ConversationEntries.createConversationEntry(ConversationEntries.java:50)
       at org.jboss.seam.core.Manager.createConversationEntry(Manager.java:649)
       at org.jboss.seam.core.Manager.beforeRedirect(Manager.java:796)
       at org.jboss.seam.core.Manager.appendConversationIdFromRedirectFilter(Manager.java:1004)
       at org.jboss.seam.servlet.SeamRedirectFilter$1.sendRedirect(SeamRedirectFilter.java:46)
       at org.apache.myfaces.context.servlet.ServletExternalContextImpl.redirect(ServletExternalContextImpl.java:493)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.restoreView(AjaxViewHandler.java:177)
       at org.jboss.seam.jsf.SeamViewHandler.restoreView(SeamViewHandler.java:64)
       at org.jenia.faces.template.handler.ViewHandler.restoreView(ViewHandler.java:263)
       at com.sun.facelets.FaceletViewHandler.restoreView(FaceletViewHandler.java:321)
       at org.ajax4jsf.framework.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:116)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.restoreView(AjaxViewHandler.java:147)
       at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:81)
       at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
       ...
      


      Has anyone else experienced this issue? Is this an issue with my configuration?

      Simple steps to reproduce: Have a page with a rich faces tree and AJAX as its method of refreshing. Wait for the user's session to time out. Try to expand a node, it will fail with the above exception.

      configuration:
      <application>
       <view-handler>org.ajax4jsf.framework.ajax.AjaxViewHandler</view-handler>
       <state-manager>org.ajax4jsf.framework.ajax.AjaxStateManager</state-manager>
       </application>
       <lifecycle>
       <phase-listener>org.ajax4jsf.framework.renderer.AjaxPhaseListener</phase-listener>
       <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener>
       </lifecycle>


      Order of my filters:
      Ajax4Jsf
      SeamRedirect
      MyFacesExtensions

      I found a Seam bug at:
      http://jira.jboss.com/jira/browse/JBSEAM-959

      It says it is fixed in 1.2.1 (which isn't released), but if I check the source code, it doesn't look like it is fixed, but instead throws a different exception. Any ideas from the A4J side?

      Thanks