6 Replies Latest reply on Oct 5, 2007 7:58 AM by Jo Geraerts

    Message Driven Bean starting jbpm process

    Jo Geraerts Newbie

      Hello all,

      I want to start a JBPM process from upon reception of a JMS Message.

      My environment is: jboss-4.2.1.GA + jboss seam 2.0.0.CR1.

      I was trying to do this first with jboss seam 1.2.1.GA but i found a jira issue reporting a bug regarding a MDB + CreateProcess (http://jira.jboss.org/jira/browse/JBSEAM-798 )


      So my very simple code ( just for testing ) looks like:

      
      package com.melexis.sandbox;
      
      import javax.ejb.ActivationConfigProperty;
      
      @Name("inklessMessageListener")
      @MessageDriven(activationConfig =
      {
      @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Topic"),
      @ActivationConfigProperty(propertyName="destination", propertyValue="topic/Shopfloor")
      })
      public class InklessMessageListener implements MessageListener {
      
       @CreateProcess(definition="inkless")
       public void onMessage(Message arg0) {
       // TODO Auto-generated method stub
      
       }
      
      }
      
      


      But get a nice exception saying:

      
      15:26:43,255 ERROR [JmsServerSession] Unexpected error delivering message SpyTextMessage {
      Header {
       jmsDestination : TOPIC.Shopfloor
       jmsDeliveryMode : 2
       jmsExpiration : 0
       jmsPriority : 4
       jmsMessageID : ID:8-11914180032041
       jmsTimeStamp : 1191418003204
       jmsCorrelationID: null
       jmsReplyTo : null
       jmsType : null
       jmsRedelivered : false
       jmsProperties : {}
       jmsPropReadWrite: false
       msgReadOnly : true
       producerClientId: ID:8
      }
      Body {
       text :<?xml version="1.0" encoding="UTF-8"?><lot><lotnumber>A93338//DE</lotnumber><item>201210600</item><organization>MLX_SOF_SOF_IO</organization><subcontractor>O_CARSEM</subcontractor><wafers><wafer id="1"><gooddiecount>1747</gooddiecount></wafer><wafer id="2"><gooddiecount>1770</gooddiecount></wafer></wafers></lot>
      }
      }
      javax.ejb.EJBTransactionRolledbackException: Transaction begin not detected, try installing transaction:ejb-transaction in components.xml
       at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:245)
       at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:268)
       at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:138)
       at $Proxy211.onMessage(Unknown Source)
       at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:178)
       at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:891)
       at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
       at org.jboss.mq.SpySession.run(SpySession.java:323)
       at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:237)
       at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
       at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
       at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
       at java.lang.Thread.run(Thread.java:595)
      
      


      So i read the exception and install transaction:ejb-transaction into my components.xml:

       <transaction:ejb-transaction/>
      


      now i get another (even longer list of exceptions)

      15:32:28,874 ERROR [JmsServerSession] Unexpected error delivering message SpyTextMessage {
      Header {
       jmsDestination : TOPIC.Shopfloor
       jmsDeliveryMode : 2
       jmsExpiration : 0
       jmsPriority : 4
       jmsMessageID : ID:11-11914183478191
       jmsTimeStamp : 1191418347819
       jmsCorrelationID: null
       jmsReplyTo : null
       jmsType : null
       jmsRedelivered : false
       jmsProperties : {}
       jmsPropReadWrite: false
       msgReadOnly : true
       producerClientId: ID:11
      }
      Body {
       text :<?xml version="1.0" encoding="UTF-8"?><lot><lotnumber>A93338//DE</lotnumber><item>201210600</item><organization>MLX_SOF_SOF_IO</organization><subcontractor>O_CARSEM</subcontractor><wafers><wafer id="1"><gooddiecount>1747</gooddiecount></wafer><wafer id="2"><gooddiecount>1770</gooddiecount></wafer></wafers></lot>
      }
      }
      javax.ejb.EJBTransactionRolledbackException
       at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:245)
       at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:268)
       at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:138)
       at $Proxy244.onMessage(Unknown Source)
       at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:178)
       at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:891)
       at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
       at org.jboss.mq.SpySession.run(SpySession.java:323)
       at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:237)
       at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
       at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
       at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.NullPointerException
       at org.jboss.seam.contexts.BusinessProcessContext.getNamesFromContext(BusinessProcessContext.java:115)
       at org.jboss.seam.contexts.BusinessProcessContext.getNames(BusinessProcessContext.java:97)
       at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:241)
       at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:356)
       at org.jboss.seam.contexts.Lifecycle.endCall(Lifecycle.java:92)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:120)
       at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
       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.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
       at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
       ... 17 more
      15:32:28,905 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
      15:32:28,907 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:de17:470359d6:2ae status: ActionStatus.ABORTED >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:de17:470359d6:2ae status: ActionStatus.ABORTED >)
      15:32:28,913 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
      15:32:28,915 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:de17:470359d6:2ae status: ActionStatus.ABORTED >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:de17:470359d6:2ae status: ActionStatus.ABORTED >)
      15:32:28,917 ERROR [DbPersistenceService] hibernate flush failed
      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:426)
       at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
       at org.hibernate.jdbc.AbstractBatcher.prepareSelectStatement(AbstractBatcher.java:123)
       at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:73)
       at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:99)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
       at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507)
       at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
       at org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:218)
       at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
       at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
       at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
       at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)
       at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)
       at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)
       at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
       at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
       at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
       at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
       at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
       at org.jbpm.persistence.db.DbPersistenceService.flushSession(DbPersistenceService.java:267)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:231)
       at org.jbpm.svc.Services.close(Services.java:222)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       at org.jboss.seam.bpm.ManagedJbpmContext.closeContext(ManagedJbpmContext.java:155)
       at org.jboss.seam.bpm.ManagedJbpmContext.afterCompletion(ManagedJbpmContext.java:131)
       at org.jboss.seam.transaction.SynchronizationRegistry.afterTransactionCompletion(SynchronizationRegistry.java:42)
       at org.jboss.seam.transaction.EjbSynchronizations.afterCompletion(EjbSynchronizations.java:75)
       at org.jboss.ejb3.stateful.SessionSynchronizationInterceptor$SFSBSessionSynchronization.afterCompletion(SessionSynchronizationInterceptor.java:91)
       at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.afterCompletion(SynchronizationImple.java:136)
       at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:340)
       at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:107)
       at com.arjuna.ats.arjuna.AtomicAction.abort(AtomicAction.java:201)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1451)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:163)
       at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:126)
       at org.jboss.resource.adapter.jms.inflow.JmsServerSession$XATransactionDemarcationStrategy.end(JmsServerSession.java:475)
       at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:248)
       at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
       at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
       at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:de17:470359d6:2ae status: ActionStatus.ABORTED >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:de17:470359d6:2ae status: ActionStatus.ABORTED >)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
       at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
       ... 46 more
      Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:de17:470359d6:2ae status: ActionStatus.ABORTED >
       at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:304)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
       ... 48 more
      15:32:28,924 ERROR [DbPersistenceService] hibernate rollback failed
      java.lang.NullPointerException
       at org.jbpm.persistence.db.DbPersistenceService.rollback(DbPersistenceService.java:299)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:233)
       at org.jbpm.svc.Services.close(Services.java:222)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       at org.jboss.seam.bpm.ManagedJbpmContext.closeContext(ManagedJbpmContext.java:155)
       at org.jboss.seam.bpm.ManagedJbpmContext.afterCompletion(ManagedJbpmContext.java:131)
       at org.jboss.seam.transaction.SynchronizationRegistry.afterTransactionCompletion(SynchronizationRegistry.java:42)
       at org.jboss.seam.transaction.EjbSynchronizations.afterCompletion(EjbSynchronizations.java:75)
       at org.jboss.ejb3.stateful.SessionSynchronizationInterceptor$SFSBSessionSynchronization.afterCompletion(SessionSynchronizationInterceptor.java:91)
       at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.afterCompletion(SynchronizationImple.java:136)
       at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:340)
       at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:107)
       at com.arjuna.ats.arjuna.AtomicAction.abort(AtomicAction.java:201)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1451)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:163)
       at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:126)
       at org.jboss.resource.adapter.jms.inflow.JmsServerSession$XATransactionDemarcationStrategy.end(JmsServerSession.java:475)
       at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:248)
       at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
       at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
       at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
       at java.lang.Thread.run(Thread.java:595)
      15:32:28,932 ERROR [Services] problem closing service 'persistence'
      org.jbpm.persistence.JbpmPersistenceException: hibernate flush failed
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:236)
       at org.jbpm.svc.Services.close(Services.java:222)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       at org.jboss.seam.bpm.ManagedJbpmContext.closeContext(ManagedJbpmContext.java:155)
       at org.jboss.seam.bpm.ManagedJbpmContext.afterCompletion(ManagedJbpmContext.java:131)
       at org.jboss.seam.transaction.SynchronizationRegistry.afterTransactionCompletion(SynchronizationRegistry.java:42)
       at org.jboss.seam.transaction.EjbSynchronizations.afterCompletion(EjbSynchronizations.java:75)
       at org.jboss.ejb3.stateful.SessionSynchronizationInterceptor$SFSBSessionSynchronization.afterCompletion(SessionSynchronizationInterceptor.java:91)
       at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.afterCompletion(SynchronizationImple.java:136)
       at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:340)
       at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:107)
       at com.arjuna.ats.arjuna.AtomicAction.abort(AtomicAction.java:201)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1451)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:163)
       at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:126)
       at org.jboss.resource.adapter.jms.inflow.JmsServerSession$XATransactionDemarcationStrategy.end(JmsServerSession.java:475)
       at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:248)
       at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
       at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
       at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: 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:426)
       at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
       at org.hibernate.jdbc.AbstractBatcher.prepareSelectStatement(AbstractBatcher.java:123)
       at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:73)
       at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:99)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
       at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507)
       at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
       at org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:218)
       at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
       at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
       at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
       at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)
       at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)
       at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)
       at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
       at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
       at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
       at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
       at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
       at org.jbpm.persistence.db.DbPersistenceService.flushSession(DbPersistenceService.java:267)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:231)
       ... 20 more
      Caused by: org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:de17:470359d6:2ae status: ActionStatus.ABORTED >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:de17:470359d6:2ae status: ActionStatus.ABORTED >)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
       at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
       ... 46 more
      Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:de17:470359d6:2ae status: ActionStatus.ABORTED >
       at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:304)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
       ... 48 more
      15:32:28,936 ERROR [SynchronizationRegistry] Exception processing transaction Synchronization after completion
      org.jbpm.JbpmException: problem closing services {persistence=org.jbpm.persistence.JbpmPersistenceException: hibernate flush failed}
       at org.jbpm.svc.Services.close(Services.java:234)
       at org.jbpm.JbpmContext.close(JbpmContext.java:139)
       at org.jboss.seam.bpm.ManagedJbpmContext.closeContext(ManagedJbpmContext.java:155)
       at org.jboss.seam.bpm.ManagedJbpmContext.afterCompletion(ManagedJbpmContext.java:131)
       at org.jboss.seam.transaction.SynchronizationRegistry.afterTransactionCompletion(SynchronizationRegistry.java:42)
       at org.jboss.seam.transaction.EjbSynchronizations.afterCompletion(EjbSynchronizations.java:75)
       at org.jboss.ejb3.stateful.SessionSynchronizationInterceptor$SFSBSessionSynchronization.afterCompletion(SessionSynchronizationInterceptor.java:91)
       at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.afterCompletion(SynchronizationImple.java:136)
       at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:340)
       at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:107)
       at com.arjuna.ats.arjuna.AtomicAction.abort(AtomicAction.java:201)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1451)
       at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:163)
       at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:126)
       at org.jboss.resource.adapter.jms.inflow.JmsServerSession$XATransactionDemarcationStrategy.end(JmsServerSession.java:475)
       at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:248)
       at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
       at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
       at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jbpm.persistence.JbpmPersistenceException: hibernate flush failed
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:236)
       at org.jbpm.svc.Services.close(Services.java:222)
       ... 19 more
      Caused by: 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:426)
       at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
       at org.hibernate.jdbc.AbstractBatcher.prepareSelectStatement(AbstractBatcher.java:123)
       at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:73)
       at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:99)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:94)
       at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
       at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:507)
       at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:499)
       at org.hibernate.engine.CascadingAction$1.cascade(CascadingAction.java:218)
       at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:268)
       at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:216)
       at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
       at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:296)
       at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:242)
       at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:219)
       at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:169)
       at org.hibernate.engine.Cascade.cascade(Cascade.java:130)
       at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:131)
       at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:122)
       at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:65)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
       at org.jbpm.persistence.db.DbPersistenceService.flushSession(DbPersistenceService.java:267)
       at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:231)
       ... 20 more
      Caused by: org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:de17:470359d6:2ae status: ActionStatus.ABORTED >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:de17:470359d6:2ae status: ActionStatus.ABORTED >)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
       at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
       at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
       ... 46 more
      Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:de17:470359d6:2ae status: ActionStatus.ABORTED >
       at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:304)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
       ... 48 more
      15:32:29,147 INFO [STDOUT] Hibernate: select processdef0_.ID_ as ID1_338_, processdef0_.NAME_ as NAME3_338_, processdef0_.DESCRIPTION_ as DESCRIPT4_338_, processdef0_.VERSION_ as VERSION5_338_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN6_338_, processdef0_.STARTSTATE_ as STARTSTATE7_338_ from JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desc limit ?
      15:32:29,153 INFO [STDOUT] Hibernate: select nextval ('hibernate_sequence')
      15:32:29,161 INFO [STDOUT] Hibernate: select nextval ('hibernate_sequence')
      


      Any clues where to look for?

      Thank you for your time,


      best regards,


      Jo


        • 1. Re: Message Driven Bean starting jbpm process
          Pete Muir Master

          Have you tried creating the process on another component which you inject into the MDB. MDBs aren't capable of handling transactions.

          • 2. Re: Message Driven Bean starting jbpm process
            Jo Geraerts Newbie

            Hello,

            What i have now:

            public class InklessMessageListener implements MessageListener {
            
             @EJB
             InklessProcessManager inklessProcessManager;
            
             //@CreateProcess(definition="inkless")
             public void onMessage(Message arg0) {
            
             inklessProcessManager.startProcess();
            
             }
            
            }
            


            and

            @Stateless
            @Name("inklessProcessManager")
            public class InklessProcessManagerImpl implements InklessProcessManager {
            
             @CreateProcess(definition="inkless")
             @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
             public void startProcess() {
             }
            
            }
            


            but this gives me transaction issues as well. I suspect the NullPointerException may be the root cause.

            05:59:11,766 ERROR [JmsServerSession] Unexpected error delivering message SpyTextMessage {
            Header {
             jmsDestination : TOPIC.Shopfloor
             jmsDeliveryMode : 2
             jmsExpiration : 0
             jmsPriority : 4
             jmsMessageID : ID:6-11914703510711
             jmsTimeStamp : 1191470351070
             jmsCorrelationID: null
             jmsReplyTo : null
             jmsType : null
             jmsRedelivered : true
             jmsProperties : {JMS_JBOSS_REDELIVERY_COUNT=1}
             jmsPropReadWrite: false
             msgReadOnly : true
             producerClientId: ID:6
            }
            Body {
             text :<?xml version="1.0" encoding="UTF-8"?><lot><lotnumber>A93338//DE</lotnumber><item>201210600</item><organization>MLX_SOF_SOF_IO</organization><subcontractor>O_CARSEM</subcontractor><wafers><wafer id="1"><gooddiecount>1747</gooddiecount></wafer><wafer id="2"><gooddiecount>1770</gooddiecount></wafer></wafers></lot>
            }
            }
            javax.ejb.EJBTransactionRolledbackException
             at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:87)
             at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
             at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:245)
             at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:268)
             at org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:138)
             at $Proxy185.onMessage(Unknown Source)
             at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:178)
             at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:891)
             at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
             at org.jboss.mq.SpySession.run(SpySession.java:323)
             at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:237)
             at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
             at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
             at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
             at java.lang.Thread.run(Thread.java:595)
            Caused by: java.lang.NullPointerException
             at org.jboss.seam.contexts.BusinessProcessContext.getNamesFromContext(BusinessProcessContext.java:115)
             at org.jboss.seam.contexts.BusinessProcessContext.getNames(BusinessProcessContext.java:97)
             at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:241)
             at org.jboss.seam.contexts.Contexts.flushAndDestroyContexts(Contexts.java:356)
             at org.jboss.seam.contexts.Lifecycle.endCall(Lifecycle.java:92)
             at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:120)
             at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
             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.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
             at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
             at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
             ... 17 more
            05:59:11,776 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
            05:59:11,776 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:dba4:47046487:87 status: ActionStatus.ABORTED >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:dba4:47046487:87 status: ActionStatus.ABORTED >)
            05:59:11,786 ERROR [SynchronizationRegistry] Exception processing transaction Synchronization after completion
            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:426)
             at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
             at org.hibernate.jdbc.AbstractBatcher.prepareSelectStatement(AbstractBatcher.java:123)
             at org.hibernate.id.SequenceGenerator.generate(SequenceGenerator.java:73)
             at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:99)
             at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
             at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
             at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
             at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
             at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
             at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
             at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
             at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
             at org.jbpm.logging.db.DbLoggingService.log(DbLoggingService.java:50)
             at org.jbpm.svc.save.SaveLogsOperation.save(SaveLogsOperation.java:47)
             at org.jbpm.svc.Services.save(Services.java:161)
             at org.jbpm.JbpmContext.save(JbpmContext.java:427)
             at org.jbpm.JbpmContext.autoSave(JbpmContext.java:620)
             at org.jbpm.JbpmContext.close(JbpmContext.java:137)
             at org.jboss.seam.bpm.ManagedJbpmContext.closeContext(ManagedJbpmContext.java:155)
             at org.jboss.seam.bpm.ManagedJbpmContext.afterCompletion(ManagedJbpmContext.java:131)
             at org.jboss.seam.transaction.SynchronizationRegistry.afterTransactionCompletion(SynchronizationRegistry.java:42)
             at org.jboss.seam.transaction.EjbSynchronizations.afterCompletion(EjbSynchronizations.java:75)
             at org.jboss.ejb3.stateful.SessionSynchronizationInterceptor$SFSBSessionSynchronization.afterCompletion(SessionSynchronizationInterceptor.java:91)
             at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.afterCompletion(SynchronizationImple.java:136)
             at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.afterCompletion(TwoPhaseCoordinator.java:340)
             at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.cancel(TwoPhaseCoordinator.java:107)
             at com.arjuna.ats.arjuna.AtomicAction.abort(AtomicAction.java:201)
             at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.rollbackAndDisassociate(TransactionImple.java:1451)
             at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.rollback(BaseTransaction.java:163)
             at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.rollback(BaseTransactionManagerDelegate.java:126)
             at org.jboss.resource.adapter.jms.inflow.JmsServerSession$XATransactionDemarcationStrategy.end(JmsServerSession.java:475)
             at org.jboss.resource.adapter.jms.inflow.JmsServerSession.run(JmsServerSession.java:248)
             at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
             at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
             at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
             at java.lang.Thread.run(Thread.java:595)
            Caused by: org.jboss.util.NestedSQLException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:dba4:47046487:87 status: ActionStatus.ABORTED >; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:dba4:47046487:87 status: ActionStatus.ABORTED >)
             at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:94)
             at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
             at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
             ... 36 more
            Caused by: javax.resource.ResourceException: Transaction is not active: tx=TransactionImple < ac, BasicAction: 7f000001:dba4:47046487:87 status: ActionStatus.ABORTED >
             at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:304)
             at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
             at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
             at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
             ... 38 more
            


            • 3. Re: Message Driven Bean starting jbpm process
              Pete Muir Master

              I don't think you want the @TransactionAttribute on your method.

              • 4. Re: Message Driven Bean starting jbpm process
                Jo Geraerts Newbie

                Hello,


                I had already tried with the TransactionAttribute removed. I looked closer to the NullPointerException in the stacktrace

                Caused by: java.lang.NullPointerException
                 at org.jboss.seam.contexts.BusinessProcessContext.getNamesFromContext(BusinessProcessContext.java:1
                15)
                



                I took a dive in this Seam code:

                
                 private Set<String> getNamesFromContext()
                 {
                 //TODO: note that this is called from Contexts.destroy(),
                 // after the Seam-managed txn was committed, but
                 // this implementation requires a hit to the database!
                 HashSet<String> results = new HashSet<String>();
                 org.jbpm.taskmgmt.exe.TaskInstance taskInstance = getTaskInstance();
                 if (taskInstance==null)
                 {
                 ContextInstance context = getContextInstance();
                 if ( context!=null )
                 {
                 results.addAll( context.getVariables().keySet() );
                 }
                 }
                 else
                 {
                 results.addAll( taskInstance.getVariables().keySet() );
                 }
                 return results;
                 }
                
                


                Apperantly context.getVariables() is null obviously causing the NullpointerException.
                I tried to quickfix this with
                
                if ( context!=null && context.getVariables() !=null )
                 {
                 results.addAll( context.getVariables().keySet() );
                 }
                
                


                I don't know if it is a correct fix but this seemed to work for me.

                Another thing that fixes the thing is actually Outjecting a variable to the business context.

                
                @Stateless
                @Name("inklessProcessManager")
                @Interceptors(SeamInterceptor.class)
                public class InklessProcessManagerImpl implements InklessProcessManager {
                
                 @Out(scope=ScopeType.BUSINESS_PROCESS, value="foo") Integer someThing;
                
                 @CreateProcess(definition="inkless")
                 public void startProcess() {
                 someThing=new Integer(5);
                 }
                
                }
                
                



                So i presume this is an bug. Shall i create a JIRA issue for this.


                Best regards,


                Jo