2 Replies Latest reply on Jun 15, 2010 8:31 AM by hbender

    Seam-Debug-Page and jBPM again

    hbender
      Hi all

      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() );
              t.signal();
              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?

      Thanks
      Heri
        • 1. Re: Seam-Debug-Page and jBPM again
          cash1981

          I have the same problem. Keep getting this error.
          I have found that putting @Transactional on the method or JavaBean where you are using jbpm helps.
          Try that and see what happens

          • 2. Re: Seam-Debug-Page and jBPM again
            hbender

            Thank you for your advice. But it seems to me not more than an ugly hacking workaround on a problem which should be solved somewhere else (within JBPM itself?). The problem only arises if I want to see the seam debug page, and this is not a production issue. Putting Transactional annotations throughout the code, without even knowing exactly what for, is definitely not an option for the productive code.
            Heri