1 Reply Latest reply on Oct 18, 2006 1:46 PM by gavin.king

    NPE in Seam conversation code

    andrew.rw.robinson

      Seam version 1.0.1

      I just had an NPE in my site. The page almost always works, so this is hard to reproduce. The use case is this:

      Web page with a conversation that has two IFRAME references. These IFRAMES contain the same JSF page URL but two difference parameters of what to load.

      Using the @RequestParameter, I load the data for each IFRAME. This IFRAME JSF page is backed by a CONVERSATION state bean. That way the parent page, and each IFRAME all have different instances of the backing bean and don't collide.

      Here is the exception:

      java.lang.NullPointerException
       at org.jboss.seam.core.Manager.touchConversationStack(Manager.java:181)
       at org.jboss.seam.core.Manager.storeConversation(Manager.java:368)
       at org.jboss.seam.jsf.AbstractSeamPhaseListener.storeAnyConversationContext(AbstractSeamPhaseListener.java:69)
       at org.jboss.seam.jsf.SeamStateManager.saveSerializedView(SeamStateManager.java:45)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:471)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
      ...


      This happened when I loaded the page for the first time. The error was in the 2nd IFRAME (page page and first IFRAME loaded fine).

      When I reloaded the page, both IFRAMEs loaded fine. The page is loaded via RequestParameters and does not depend on any state when it first loads, so that shouldn't be an issue.

      The XHTML code snippet looks like:
      <iframe src="#{osu:getActionUrl(
       '/pages/liveReport/viewReportInFrame.xhtml')}?reportName=#{
       value.itemInfo.item.name}&appSet=#{webPageView.appSet}"
       style="width: 100%; height: 100%; border-width: 0px;">
       </iframe>
      


      Any ideas on why it failed the one time?