1 Reply Latest reply on May 28, 2010 8:48 AM by Nicklas Karlsson

    Seam-Debug-Page and jBPM

    Heri Bender Newbie

      After I have accessed some JBPM stuff programmatically within a seam component (backing bean of a xhtml page, long running conversation started) I cannot call the seam debug page anymore. The error is:

      "JbpmContext may only be used inside a transaction"

      I do not actively put this JbpmContext into the conversation context.

      The code I execute (in a @Observer(value="org.jboss.seam.beginConversation" method) :

              JbpmContext jbpmContext = ManagedJbpmContext.instance();
              GraphSession graphSession = jbpmContext.getGraphSession();

              ProcessDefinition processDefinition = graphSession.findLatestProcessDefinition("pdPUKRetrieval");
              graphSession.findProcessInstances( 0 );

              ProcessInstance processInstance = new ProcessInstance(processDefinition);

              org.jbpm.graph.exe.Token t = processInstance.getRootToken();

              myLog.debug( "token.node before signal: " + t.getNode().getName() );
              myLog.debug( "token.node after signal: " + t.getNode().getName() );

      What can I do to prevent this error?

      I work with seam 2.2.0.EAP5 and jBPM 3.2.5 SP5

      The above question was putted into the jBPM forum a while ago but not answered. So I put it here again.

      Meanwhile I have experienced the same error even if I work with jBPM annotations. I never access the jBPM API programmatically, but as soon a business process is up, one cannot call the seam debug page. I often have also the same error in log after having handled a full request, whithout having the error at the client side (the browser shows the page as expected, but in log I see a WARN:
      "Exception calling component @Destroy method: org.jboss.seam.bpm.jbpmContext
      org.hibernate.SessionException: Session is closed!"
      Which seems to me the same issue.

      What can cause this problem?