JBoss Community

Re: org.jbpm.workflow.instance.WorkflowRuntimeException: -- Illegal method call. This session was previously disposed.

created by Maciej Swiderski in jBPM Development - View the full discussion

problem is that you try to use (probably by mistake) a disposed session:

 

                   // Let's reload the session

                  StatefulKnowledgeSession loadedKsession = JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId, kbase, null, env);

                  // All the listeners and WorkItemHandlers are volatile, so we need to register them each time that we reload the session

                  //  from the DB.

                  LocalHTWorkItemHandler localHTWorkItemHandler2 = new LocalHTWorkItemHandler(client, ksession);

 

ksession (marked in bold) is disposed session and thus should not be used any more. Use instead session that you just loaded (loadedKsession) and the program will work just fine.

 

HTH

Reply to this message by going to Community

Start a new discussion in jBPM Development at Community