2 Replies Latest reply on Oct 15, 2008 12:59 PM by Nikolay Elenkov

    Conversation.isLongRunning() causes NPE

    Nikolay Elenkov Master


      I have a couple of methods that log conversation start/end for debugging purposes in may app.
      The code is pretty simple:

      @Observer(value = "org.jboss.seam.beginConversation")
      public void onConversationStart() {
        log.debug("CONVERSATION Started");
        Conversation c = Conversation.instance();
        log.debug(String.format("id: %s; isLongRunning %s; viewId: %s", 
           c.getId(), c.isLongRunning(), c.getViewId()));

      Most of the time that works OK, but I get an occasional NPE, seems to happen when you access
      the app right after JBoss has started. Here is the trace:

      Caused by: java.lang.NullPointerException
           at org.jboss.seam.core.Manager.isReallyLongRunningConversation(Manager.java:230)
           at org.jboss.seam.core.Conversation.isLongRunning(Conversation.java:308)
           at myapp.LoggerBean.onConversationEnd(LoggerBean.java:145)

      I can't catch it the debugger, so not sure what exactly causes the NPE. Any ideas?

      Environment: JBoss 4.2.2, Seam 2.0.3