2 Replies Latest reply on Nov 16, 2006 8:18 AM by xxxx xx

    Containermanaged EJB / jBPM problems

    d b Newbie

      I want to create a stateless container managed EJB 2.1.

      I follow the user guide, and the deployProcessess() is exactly as described in the user guide.
      When I comment out jbpmContext.close(); I get a warning about unclosed connection (see below), when I leave it in I get hard errors (see below).

      Can anyone please point out where I go wrong?

      public void deployProcessess() throws java.io.IOException {
      
       JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
      
       try {
      
       String xmlFile = "someprocess.xml";
      
       log.debug(logPrefix + "deployProcess: Attempt to load " + xmlFile);
       //load and parse the xml file
       java.io.InputStream is = this.getClass().getResourceAsStream(xmlFile);
      
       ProcessDefinition processDefinition = ProcessDefinition.parseXmlInputStream(is);
      
       // Save the process definition in the database
       jbpmContext.deployProcessDefinition(processDefinition);
       }
       } finally {
       jbpmContext.close();
       }
       }
      }
      


      jbpm.cfg.xml
      <jbpm-configuration>
      
       <jbpm-context>
       <service name="persistence" factory="org.jbpm.persistence.db.DbPersistenceServiceFactory">
       <field name="isTransactionEnabled"><false /></field>
       </service>
      
       <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
       <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
       <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
       <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
       </jbpm-context>
      
       <!-- configuration resource files pointing to default configuration files in jbpm-{version}.jar -->
       <string name="resource.hibernate.cfg.xml" value="hibernate.cfg.xml" />
       <!-- <string name="resource.hibernate.properties" value="hibernate.properties" /> -->
       <string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties" />
       <string name="resource.default.modules" value="org/jbpm/graph/def/jbpm.default.modules.properties" />
       <string name="resource.converter" value="org/jbpm/db/hibernate/jbpm.converter.properties" />
       <string name="resource.action.types" value="org/jbpm/graph/action/action.types.xml" />
       <string name="resource.node.types" value="org/jbpm/graph/node/node.types.xml" />
       <string name="resource.parsers" value="org/jbpm/jpdl/par/jbpm.parsers.xml" />
       <string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml" />
      
       <bean name="jbpm.task.instance.factory" class="org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl" singleton="true" />
       <bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" />
       <long name="jbpm.msg.wait.timout" value="5000" singleton="true" />
      
      </jbpm-configuration>
      




      Message when I commented out jbpmContext.close();
      09:41:38,625 INFO : RDBMS: MySQL, version: 5.0.19-nt-log
      09:41:38,625 INFO : JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.12 ( $Date: 2005-11-17 15:53:48 +0100 (Thu, 17 Nov 2005) $, $Revision$ )
      09:41:38,625 INFO : Using dialect: org.hibernate.dialect.MySQLDialect
      09:41:38,641 INFO : Using default transaction strategy (direct JDBC transactions)
      09:41:38,641 INFO : No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
      09:41:38,641 INFO : Automatic flush during beforeCompletion(): disabled
      09:41:38,641 INFO : Automatic session close at end of transaction: disabled
      09:41:38,641 INFO : JDBC batch size: 15
      09:41:38,641 INFO : JDBC batch updates for versioned data: disabled
      09:41:38,641 INFO : Scrollable result sets: enabled
      09:41:38,641 INFO : JDBC3 getGeneratedKeys(): enabled
      09:41:38,641 INFO : Connection release mode: auto
      09:41:38,641 INFO : Maximum outer join fetch depth: 2
      09:41:38,641 INFO : Default batch fetch size: 1
      09:41:38,641 INFO : Generate SQL with comments: disabled
      09:41:38,641 INFO : Order SQL updates by primary key: disabled
      09:41:38,641 INFO : Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
      09:41:38,641 INFO : Using ASTQueryTranslatorFactory
      09:41:38,641 INFO : Query language substitutions: {}
      09:41:38,641 INFO : Second-level cache: enabled
      09:41:38,641 INFO : Query cache: disabled
      09:41:38,641 INFO : Cache provider: org.hibernate.cache.EhCacheProvider
      09:41:38,641 INFO : Optimize cache for minimal puts: disabled
      09:41:38,657 INFO : Structured second-level cache entries: disabled
      09:41:38,657 INFO : Statistics: disabled
      09:41:38,657 INFO : Deleted entity synthetic identifier rollback: disabled
      09:41:38,657 INFO : Default entity-mode: POJO
      09:41:38,657 INFO : building session factory
      09:41:39,641 INFO : Not binding factory to JNDI, no JNDI name configured
      09:41:39,656 INFO : Checking 28 named queries
      09:41:39,735 TRACE: getPrincipal, principal=null
      09:41:39,735 TRACE: Begin isValid, principal:null, cache info: org.jboss.security.plugins.JaasSecurityManager$DomainInfo@4479b2[Subject(15564636).principals=org.jboss.security.SimplePrincipal@5487610(root),credential.class=null,expirationTime=1158134690868]
      09:41:39,735 TRACE: Begin validateCache, info=org.jboss.security.plugins.JaasSecurityManager$DomainInfo@4479b2[Subject(15564636).principals=org.jboss.security.SimplePrincipal@5487610(root),credential.class=null,expirationTime=1158134690868];credential.class=null
      09:41:39,735 TRACE: End validateCache, isValid=true
      09:41:39,735 TRACE: End isValid, true
      09:41:41,031 INFO : Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@1da30c3
      java.lang.Throwable: STACKTRACE
      
       at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:333)
      
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:482)
      
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:894)
      
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:73)
      
       at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
      
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:304)
      
       at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:109)
      
       at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:134)
      
       at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
      
       at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1236)
      
       at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:98)
      
       at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:217)
      
       at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:537)
      
       at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
      
       at com.package.app.workflow.WorkflowManagerBean.deployProcessess(WorkflowManagerBean.java:146)
      
       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.jboss.invocation.Invocation.performCall(Invocation.java:345)
      
       at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
      
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)
      
       at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)
      
       at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:54)
      
       at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
      
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
      
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
      
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
      
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
      
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
      
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      
       at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
      
       at org.jboss.ejb.Container.invoke(Container.java:873)
      
       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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      
       at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
      
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
      
       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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
      
       at sun.rmi.transport.Transport$1.run(Transport.java:153)
      
       at java.security.AccessController.doPrivileged(Native Method)
      
       at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
      
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      
       at java.lang.Thread.run(Thread.java:595)
      
      09:41:41,062 TRACE: popRunAsIdentity, runAs=null
      09:41:41,062 TRACE: popSubjectContext, sc=org.jboss.security.SecurityAssociation$SubjectContext@6b1066{principal=null,subject=null}
      


      Message when I use jbpmContext.close();
      09:50:55,108 INFO : RDBMS: MySQL, version: 5.0.19-nt-log
      09:50:55,108 INFO : JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.12 ( $Date: 2005-11-17 15:53:48 +0100 (Thu, 17 Nov 2005) $, $Revision$ )
      09:50:55,108 INFO : Using dialect: org.hibernate.dialect.MySQLDialect
      09:50:55,108 INFO : Using default transaction strategy (direct JDBC transactions)
      09:50:55,124 INFO : No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
      09:50:55,124 INFO : Automatic flush during beforeCompletion(): disabled
      09:50:55,124 INFO : Automatic session close at end of transaction: disabled
      09:50:55,124 INFO : JDBC batch size: 15
      09:50:55,124 INFO : JDBC batch updates for versioned data: disabled
      09:50:55,124 INFO : Scrollable result sets: enabled
      09:50:55,124 INFO : JDBC3 getGeneratedKeys(): enabled
      09:50:55,124 INFO : Connection release mode: auto
      09:50:55,124 INFO : Maximum outer join fetch depth: 2
      09:50:55,124 INFO : Default batch fetch size: 1
      09:50:55,124 INFO : Generate SQL with comments: disabled
      09:50:55,124 INFO : Order SQL updates by primary key: disabled
      09:50:55,124 INFO : Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
      09:50:55,124 INFO : Using ASTQueryTranslatorFactory
      09:50:55,124 INFO : Query language substitutions: {}
      09:50:55,140 INFO : Second-level cache: enabled
      09:50:55,140 INFO : Query cache: disabled
      09:50:55,140 INFO : Cache provider: org.hibernate.cache.EhCacheProvider
      09:50:55,140 INFO : Optimize cache for minimal puts: disabled
      09:50:55,140 INFO : Structured second-level cache entries: disabled
      09:50:55,140 INFO : Statistics: disabled
      09:50:55,140 INFO : Deleted entity synthetic identifier rollback: disabled
      09:50:55,140 INFO : Default entity-mode: POJO
      09:50:55,140 INFO : building session factory
      09:50:56,077 INFO : Not binding factory to JNDI, no JNDI name configured
      09:50:56,077 INFO : Checking 28 named queries
      09:50:56,155 TRACE: getPrincipal, principal=null
      09:50:56,155 TRACE: Begin isValid, principal:null, cache info: org.jboss.security.plugins.JaasSecurityManager$DomainInfo@4479b2[Subject(15564636).principals=org.jboss.security.SimplePrincipal@5487610(root),credential.class=null,expirationTime=1158134690868]
      09:50:56,155 TRACE: Begin validateCache, info=org.jboss.security.plugins.JaasSecurityManager$DomainInfo@4479b2[Subject(15564636).principals=org.jboss.security.SimplePrincipal@5487610(root),credential.class=null,expirationTime=1158134690868];credential.class=null
      09:50:56,155 TRACE: End validateCache, isValid=true
      09:50:56,155 TRACE: End isValid, true
      09:50:57,671 ERROR: JDBC commit failed
      java.sql.SQLException: You cannot commit during a managed transaction!
      
       at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:432)
      
       at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:331)
      
       at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:139)
      
       at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:115)
      
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:162)
      
       at org.jbpm.svc.Services.close(Services.java:211)
      
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
      
       at our.package.app.workflow.WorkflowManagerBean.deployProcessess(WorkflowManagerBean.java:149)
      
       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.jboss.invocation.Invocation.performCall(Invocation.java:345)
      
       at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
      
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)
      
       at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)
      
       at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:54)
      
       at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
      
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
      
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
      
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
      
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
      
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
      
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      
       at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
      
       at org.jboss.ejb.Container.invoke(Container.java:873)
      
       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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      
       at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
      
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
      
       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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
      
       at sun.rmi.transport.Transport$1.run(Transport.java:153)
      
       at java.security.AccessController.doPrivileged(Native Method)
      
       at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
      
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      
       at java.lang.Thread.run(Thread.java:595)
      
      09:50:57,905 INFO : org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session
      09:50:57,905 INFO : at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:172)
      09:50:57,905 INFO : at org.jbpm.svc.Services.close(Services.java:211)
      09:50:57,921 INFO : at org.jbpm.JbpmContext.close(JbpmContext.java:139)
      09:50:57,921 INFO : at our.package.app.workflow.WorkflowManagerBean.deployProcessess(WorkflowManagerBean.java:149)
      09:50:57,921 INFO : at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      09:50:57,921 INFO : at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      09:50:57,921 INFO : at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:50:57,921 INFO : at java.lang.reflect.Method.invoke(Method.java:585)
      09:50:57,921 INFO : at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
      09:50:57,921 INFO : at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
      09:50:57,921 INFO : at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)
      09:50:57,921 INFO : at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)
      09:50:57,921 INFO : at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:54)
      09:50:57,921 INFO : at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
      09:50:57,921 INFO : at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
      09:50:57,921 INFO : at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
      09:50:57,937 INFO : at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
      09:50:57,937 INFO : at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
      09:50:57,937 INFO : at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
      09:50:57,937 INFO : at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      09:50:57,937 INFO : at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
      09:50:57,937 INFO : at org.jboss.ejb.Container.invoke(Container.java:873)
      09:50:57,937 INFO : at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      09:50:57,937 INFO : at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      09:50:57,937 INFO : at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:50:57,937 INFO : at java.lang.reflect.Method.invoke(Method.java:585)
      09:50:57,937 INFO : at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      09:50:57,937 INFO : at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      09:50:57,937 INFO : at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      09:50:57,952 INFO : at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      09:50:57,952 INFO : at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      09:50:57,952 INFO : at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
      09:50:57,952 INFO : at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
      09:50:57,952 INFO : at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      09:50:57,952 INFO : at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      09:50:57,952 INFO : at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:50:57,952 INFO : at java.lang.reflect.Method.invoke(Method.java:585)
      09:50:57,952 INFO : at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
      09:50:57,952 INFO : at sun.rmi.transport.Transport$1.run(Transport.java:153)
      09:50:57,952 INFO : at java.security.AccessController.doPrivileged(Native Method)
      09:50:57,952 INFO : at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
      09:50:57,952 INFO : at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      09:50:57,952 INFO : at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      09:50:57,968 INFO : at java.lang.Thread.run(Thread.java:595)
      09:50:57,968 INFO : Caused by: org.hibernate.TransactionException: JDBC commit failed
      09:50:57,968 INFO : at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:130)
      09:50:57,968 INFO : at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:162)
      09:50:57,968 INFO : ... 43 more
      09:50:57,968 INFO : Caused by: java.sql.SQLException: You cannot commit during a managed transaction!
      09:50:57,968 INFO : at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:432)
      09:50:57,968 INFO : at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:331)
      09:50:57,968 INFO : at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:139)
      09:50:57,968 INFO : at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:115)
      09:50:57,968 INFO : ... 44 more
      09:50:57,968 ERROR: problem closing service 'persistence'
      org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session
      
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:172)
      
       at org.jbpm.svc.Services.close(Services.java:211)
      
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
      
       at our.package.app.workflow.WorkflowManagerBean.deployProcessess(WorkflowManagerBean.java:149)
      
       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.jboss.invocation.Invocation.performCall(Invocation.java:345)
      
       at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
      
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)
      
       at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)
      
       at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:54)
      
       at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
      
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
      
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
      
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
      
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
      
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
      
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      
       at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
      
       at org.jboss.ejb.Container.invoke(Container.java:873)
      
       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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      
       at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
      
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
      
       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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
      
       at sun.rmi.transport.Transport$1.run(Transport.java:153)
      
       at java.security.AccessController.doPrivileged(Native Method)
      
       at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
      
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      
       at java.lang.Thread.run(Thread.java:595)
      
      Caused by: org.hibernate.TransactionException: JDBC commit failed
      
       at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:130)
      
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:162)
      
       ... 43 more
      
      Caused by: java.sql.SQLException: You cannot commit during a managed transaction!
      
       at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:432)
      
       at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:331)
      
       at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:139)
      
       at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:115)
      
       ... 44 more
      
      09:50:58,140 TRACE: popRunAsIdentity, runAs=null
      09:50:58,140 TRACE: popSubjectContext, sc=org.jboss.security.SecurityAssociation$SubjectContext@18e282c{principal=null,subject=null}
      09:50:58,140 ERROR: RuntimeException in method: public abstract void our.package.app.workflow.WorkflowManager.deployProcessess() throws java.io.IOException,java.rmi.RemoteException:
      org.jbpm.JbpmException: problem closing services {persistence=org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session}
      
       at org.jbpm.svc.Services.close(Services.java:223)
      
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
      
       at our.package.app.workflow.WorkflowManagerBean.deployProcessess(WorkflowManagerBean.java:149)
      
       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.jboss.invocation.Invocation.performCall(Invocation.java:345)
      
       at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
      
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)
      
       at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)
      
       at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:54)
      
       at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
      
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
      
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
      
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
      
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
      
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
      
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      
       at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
      
       at org.jboss.ejb.Container.invoke(Container.java:873)
      
       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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
      
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
      
       at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
      
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
      
       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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
      
       at sun.rmi.transport.Transport$1.run(Transport.java:153)
      
       at java.security.AccessController.doPrivileged(Native Method)
      
       at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
      
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      
       at java.lang.Thread.run(Thread.java:595)
      
      Caused by: org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session
      
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:172)
      
       at org.jbpm.svc.Services.close(Services.java:211)
      
       ... 42 more
      
      Caused by: org.hibernate.TransactionException: JDBC commit failed
      
       at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:130)
      
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:162)
      
       ... 43 more
      
      Caused by: java.sql.SQLException: You cannot commit during a managed transaction!
      
       at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit(BaseWrapperManagedConnection.java:432)
      
       at org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:331)
      
       at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:139)
      
       at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:115)
      
       ... 44 more
      
      
      


        • 1. Re: Containermanaged EJB / jBPM problems
          xxxx xx Newbie

          I have the same problem. I use through a stateless session bean (EJB 2.0) jbpm 3.1.3 with jboss 4.0.4 (so I choosed the JBossAuthenticationServiceFactory for authentication service in jbpm) on posgreSQL 7.4.

          Did you find a solution ?

          13:16:17,984 DEBUG [JbpmContextInfo] creating jbpm context with service factories '[message, scheduler, logging, persistence, authentication]'
          13:16:17,984 DEBUG [JbpmContext] creating JbpmContext
          13:16:17,984 DEBUG [DbPersistenceServiceFactory] creating persistence service
          13:16:17,984 DEBUG [DbPersistenceService] fetching jdbc connection from datasource
          13:16:17,984 DEBUG [DbPersistenceService] creating hibernate session with connection org.jboss.resource.adapter.jdbc.WrappedConnection@1399a27
          13:16:17,984 DEBUG [JbpmContext] closing JbpmContext
          13:16:17,984 DEBUG [Services] closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@1b9528e
          13:16:17,984 DEBUG [DbPersistenceService] flushing hibernate session
          13:16:17,984 DEBUG [DbPersistenceService] closing hibernate session
          13:16:17,984 INFO [CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.WrappedConnection@1399a27
          java.lang.Throwable: STACKTRACE
           at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)
           at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:400)
           at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:812)
           at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
           at org.jbpm.persistence.db.DbPersistenceService.getConnection(DbPersistenceService.java:113)
           at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:81)
           at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:227)
           at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:545)
           at org.jbpm.ejb.JbpmEjbSessionBean.findLatestProcessDefinition(JbpmEjbSessionBean.java:267)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
           at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237)
           at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
           at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169)
           at org.jboss.ws.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:64)
           at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
           at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
           at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
           at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
           at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168)
           at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
           at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
           at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648)
           at org.jboss.ejb.Container.invoke(Container.java:954)
           at sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
           at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:819)
           at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:420)
           at sun.reflect.GeneratedMethodAccessor137.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
           at sun.rmi.transport.Transport$1.run(Unknown Source)
           at java.security.AccessController.doPrivileged(Native Method)
           at sun.rmi.transport.Transport.serviceCall(Unknown Source)
           at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
           at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
           at java.lang.Thread.run(Unknown Source)


          • 2. Re: Containermanaged EJB / jBPM problems
            xxxx xx Newbie

            As described in
            http://www.jboss.org/wiki/Wiki.jsp?page=WhatDoesTheMessageDoYourOwnHousekeepingMean

            I changed the debug attribute to false in jbossjca-service.xml then no more error messages about connection