6 Replies Latest reply on Aug 3, 2007 4:46 AM by Bernd Ruecker

    Problem with GraphElement.raiseException

    Bernd Ruecker Master

      Hi,

      we currently invoke a EJB-SessionBean out of a action in jBPM 3.1.1. jBPM runs ins the same JTA-Transaction as our SessionBean.

      Now a BusinessException occurs in the called SessionBean, which causes to set rollbackOnly on the JTA-Transaction in the SessionBean. The the Exception is thrown to jBPM.

      jBPM wants to look for ExceptionHandlers, but that fails with an own exception:

      7:14:29,875 INFO [DefaultLoadEventListener] Error performing load command
      org.hibernate.exception.GenericJDBCException: Cannot open connection
       at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:420)
       at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
       at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
       at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
       at org.hibernate.loader.Loader.doQuery(Loader.java:661)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
       at org.hibernate.loader.Loader.loadEntity(Loader.java:1785)
       at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:48)
       at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:42)
       at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2821)
       at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:370)
       at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:351)
       at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:122)
       at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:81)
       at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:871)
       at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:829)
       at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:66)
       at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)
       at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:160)
       at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$cb896060.equals(<generated>)
       at org.jbpm.util.EqualsUtil.equals(EqualsUtil.java:30)
       at org.jbpm.graph.def.GraphElement.equals(GraphElement.java:418)
       at org.jbpm.graph.def.GraphElement$$FastClassByCGLIB$$7a7d6aa6.invoke(<generated>)
       at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
       at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
       at org.jbpm.graph.node.TaskNode$$EnhancerByCGLIB$$78d101e.equals(<generated>)
       at org.jbpm.graph.def.Transition.getParent(Transition.java:204)
       at org.jbpm.graph.def.GraphElement.raiseException(GraphElement.java:338)
       at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:248)
       at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:212)
       at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:182)
       at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:166)
       at org.jbpm.graph.def.Transition.take(Transition.java:106)
       at org.jbpm.graph.def.Node.leave(Node.java:382)
       at org.jbpm.graph.node.TaskNode.leave(TaskNode.java:198)
       at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke(<generated>)
       at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
       at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
       at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$cb896060.leave(<generated>)
       at org.jbpm.graph.exe.Token.signal(Token.java:174)
       at org.jbpm.graph.exe.Token.signal(Token.java:145)
       at org.jbpm.graph.exe.Token$$FastClassByCGLIB$$74df1c6e.invoke(<generated>)
       at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
       at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
       at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$fae2cddc.signal(<generated>)
       at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:420)
       at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:359)
       at org.jbpm.taskmgmt.exe.TaskInstance$$FastClassByCGLIB$$cb2c21af.invoke(<generated>)
       at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
       at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
       at org.jbpm.taskmgmt.exe.TaskInstance$$EnhancerByCGLIB$$cbd8230f.end(<generated>)
       at com.camunda.toolkit.jbpm.service.AdminServicesImpl.endTask(AdminServicesImpl.java:1452)
      


      My guess is, that Hibernate can not load anything new because the transaction is already marked for rollback.

      Am I right? Is there a easy workaround or something like that? The ugly thide of this, is that the real Exception "gets lost" and van not be thrown to the client any more...

      Many thanks and best regards

      Bernd