2 Replies Latest reply on Dec 3, 2008 5:15 AM by franze francesco

    Help with a Jbpm error

    franze francesco Newbie

      Hi all, I'm trying to retrieve the value of some variables added to a remote jbpm process, but when I request the ContextIstance it gaves this error

      org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jbpm.context.exe.TokenVariableMap.variableInstances, no session or session was closed

      I tryed another way to catch the variables, with the following code



      ProcessInstance processInstance1=this.prendiIstanzaWorkflow(workflowDT);
      VariablesCommand variabile= new VariablesCommand();
      token = processInstance1.getRootToken();

      variabile.setTokenId(token.getId());
      Object o=servizioWorkflowJbpm.execute(variabile);
      TokenVariableMap tmv=(TokenVariableMap) o;
      ContextInstance cc=tmv.getContextInstance();
      Map map = cc.getVariables();


      but the error is the same Can someone help me? Thanks.
      There the full stack trace

      ERROR [org.hibernate.LazyInitializationException] - failed to lazily initialize a collection of role: org.jbpm.context.exe.TokenVariableMap.variableInstances, no session or session was closed
      org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jbpm.context.exe.TokenVariableMap.variableInstances, no session or session was closed
      at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
      at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
      at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
      at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
      at org.hibernate.collection.PersistentMap.entrySet(PersistentMap.java:206)
      at org.jbpm.context.exe.VariableContainer.getVariablesLocally(VariableContainer.java:119)
      at org.jbpm.context.exe.VariableContainer.getVariables(VariableContainer.java:106)
      at org.jbpm.context.exe.ContextInstance.getVariables(ContextInstance.java:106)
      at org.jbpm.context.exe.ContextInstance.getVariables(ContextInstance.java:95)
      at com.linksmt.fpap.services.WorkflowJbpmService.prendiInfo(WorkflowJbpmService.java:109)
      at com.linksmt.fpap.services.WorkflowJbpmService.infoStatoCorrente(WorkflowJbpmService.java:76)
      at com.linksmt.fpap.controllers.TestWorkflowController.handleRequestInternal(TestWorkflowController.java:31)
      at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
      at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:523)
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:453)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:619)