[jboss-user] [JBoss jBPM] - when i end the TaskInstance, an LazyInitializationException o
foolpcman
do-not-reply at jboss.com
Wed Aug 1 03:37:11 EDT 2007
first,i want say sorry ,because i'm a Chinese and english isn't well.
i think you can know the folowing language:
when i do this:
RndfReport businessReport = new RndfReport();
| businessReport.setExampleName(example_name);
| businessReport.setExampleRemark(example_remark);
|
| JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
| Session hsession = jbpmContext.getSessionFactory().openSession();
| Transaction transaction = hsession.beginTransaction();
| try {
|
| hsession.save(businessReport);
| transaction.commit();
| ProcessDefinition pd = jbpmContext.getGraphSession().findLatestProcessDefinition("RNDFProcess");
| ProcessInstance pi = pd.createProcessInstance();
| pi.getContextInstance().setVariable("username", from_username);
| TaskInstance ti = pi.getTaskMgmtInstance().createStartTaskInstance();
| ti.setVariable("report_id", businessReport.getReportId());
| ti.end();
| } catch (Exception e) {
| System.out.println("Unknown error in the SaveGo().");
| return_code = Property.SQL_ERROR;
| message = "?????????";
| event_type = "";
| e.getMessage();
| e.printStackTrace();
| transaction.rollback();
| }finally{
| hsession.close();
| jbpmContext.close();
| }
exception:15:06:16,671 [http8001-Processor25] ERROR LazyInitializationException : failed to lazily initialize a collection of role: org.jbpm.graph.def.Node.leavingTransitions, no session or session was closed
| org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.jbpm.graph.def.Node.leavingTransitions, 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.readSize(AbstractPersistentCollection.java:97)
| at org.hibernate.collection.PersistentList.size(PersistentList.java:91)
| at org.jbpm.graph.def.Node.getDefaultLeavingTransition(Node.java:217)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:147)
| at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$57ae0d8c.getDefaultLeavingTransition(<generated>)
| at org.jbpm.graph.exe.Token.signal(Token.java:136)
| at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:475)
| at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:389)
| at buesiness.BusinessEngine.SaveGo(BusinessEngine.java:119)
| at buesiness.BusinessEngine.exectue(BusinessEngine.java:63)
| at org.apache.jsp.order_005fexec_jsp._jspService(order_005fexec_jsp.java:99)
| at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
| at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
| at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
| at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
| at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
| at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
| at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
| at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
| at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
| at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
| at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
| at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
| at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:209)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:670)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:517)
| at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:575)
| at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
| at java.lang.Thread.run(Thread.java:595)
thank you !!!!!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069508#4069508
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069508
More information about the jboss-user
mailing list