1 Reply Latest reply on May 31, 2016 7:48 AM by jimmy001

    JBPM 6.3.0 + wildfly 9.0.2 + hibernate 5: severe transaction problem

    Vicenzo Ricca Newbie

      Dear All

       

      I'm trying to install JBPM 6.3.0 as embedded in a EAR. I'm having severe problems during process deployment.

       

      @Startup

      @Singleton

      @DependsOn("AnotherBean")

      public class ProcessEngineService {

          @EJB

          DeploymentServiceEJBLocal deploymentService;

          @PostConstruct

          public void init() {      

          System.out.println("in ProcessEngineService - @PostConstruct");   

              String[] gav = JBPMConstants.ACQ_PROCESS_DEPLOYMENT_ID.split(":");

              DeploymentUnit deploymentUnit = new KModuleDeploymentUnit(gav[0], gav[1], gav[2]);

              deploymentService.deploy(deploymentUnit);

          }

      }

       

      I have a user transaction's problem because JBPM persistence cannot find any valid UserTransaction. The error is as follows:

       

      DEBUG o.d.p.jta.JtaTransactionManager - No UserTransaction found at JNDI location [java:comp/UserTransaction]

      17:37:10,987 INFO  [stdout] (ServerService Thread Pool -- 91) javax.naming.NameNotFoundException: UserTransaction

      ...........

      Caused by: java.lang.IllegalStateException: WFLYEJB0137: Only session and message-driven beans with bean-managed transaction demarcation are allowed to access UserTransaction

      ...........

      javax.naming.NameNotFoundException: UserTransaction

      17:37:11,024 INFO  [stdout] (ServerService Thread Pool -- 84) at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:153) [wildfly-naming-9.0.2.Final.jar!/:9.0.2.Final]

      17:37:11,033 INFO  [stdout] (ServerService Thread Pool -- 84) at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:83) [wildfly-naming-9.0.2.Final.jar!/:9.0.2.Final]

      17:37:11,033 INFO  [stdout] (ServerService Thread Pool -- 84) at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:207) [wildfly-naming-9.0.2.Final.jar!/:9.0.2.Final]

      17:37:11,033 INFO  [stdout] (ServerService Thread Pool -- 84) at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184) [wildfly-naming-9.0.2.Final.jar!/:9.0.2.Final]

      17:37:11,033 INFO  [stdout] (ServerService Thread Pool -- 84) at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:237) ~[na:na]

      17:37:11,033 INFO  [stdout] (ServerService Thread Pool -- 84) at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:193) [wildfly-naming-9.0.2.Final.jar!/:9.0.2.Final]

      17:37:11,035 INFO  [stdout] (ServerService Thread Pool -- 84) at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:189) [wildfly-naming-9.0.2.Final.jar!/:9.0.2.Final]

      17:37:11,035 INFO  [stdout] (ServerService Thread Pool -- 84) at javax.naming.InitialContext.lookup(InitialContext.java:417) ~[na:1.8.0_65]

      17:37:11,035 INFO  [stdout] (ServerService Thread Pool -- 84) at javax.naming.InitialContext.lookup(InitialContext.java:417) ~[na:1.8.0_65]

      17:37:11,035 INFO  [stdout] (ServerService Thread Pool -- 84) at org.drools.persistence.jta.JtaTransactionManager.findUserTransaction(JtaTransactionManager.java:132) [drools-persistence-jpa-6.3.0.Final.jar:6.3.0.Final]

      17:37:11,035 INFO  [stdout] (ServerService Thread Pool -- 84) at org.drools.persistence.jta.JtaTransactionManager.<init>(JtaTransactionManager.java:80) [drools-persistence-jpa-6.3.0.Final.jar:6.3.0.Final]

      17:37:11,035 INFO  [stdout] (ServerService Thread Pool -- 84) at org.jbpm.shared.services.impl.TransactionalCommandService.<init>(TransactionalCommandService.java:38) [jbpm-shared-services-6.3.0.Final.jar:6.3.0.Final]

      17:37:11,035 INFO  [stdout] (ServerService Thread Pool -- 84) at org.jbpm.services.ejb.impl.tx.TransactionalCommandServiceEJBImpl.<init>(TransactionalCommandServiceEJBImpl.java:37) [jbpm-services-ejb-impl-6.3.0.Final.jar:6.3.0.Final]

      17:37:11,036 INFO  [stdout] (ServerService Thread Pool -- 84) at org.jbpm.services.ejb.impl.tx.TransactionalCommandServiceEJBImpl$$$view16.<init>(Unknown Source) [jbpm-services-ejb-impl-6.3.0.Final.jar:6.3.0.Final]

      ......

      17:37:11,050 INFO  [stdout] (ServerService Thread Pool -- 91) 17:37:11.023 [ServerService Thread Pool -- 91] DEBUG o.d.p.jta.JtaTransactionManager - Unable to find transaction: {}. Might be running in CMT environmentUserTransaction

      17:37:11,052 INFO  [stdout] (ServerService Thread Pool -- 91) 17:37:11.052 [ServerService Thread Pool -- 91] DEBUG o.d.p.jta.JtaTransactionManager - No JTA TransactionManager found at fallback JNDI location [java:comp/TransactionManager]

      17:37:11,053 INFO  [stdout] (ServerService Thread Pool -- 91) 17:37:11.053 [ServerService Thread Pool -- 91] DEBUG o.d.p.jta.JtaTransactionManager - No JTA TransactionManager found at fallback JNDI location [java:appserver/TransactionManager]

      17:37:11,053 INFO  [stdout] (ServerService Thread Pool -- 91) 17:37:11.053 [ServerService Thread Pool -- 91] DEBUG o.d.p.jta.JtaTransactionManager - No JTA TransactionManager found at fallback JNDI location [java:pm/TransactionManager]

      17:37:11,054 INFO  [stdout] (ServerService Thread Pool -- 91) 17:37:11.054 [ServerService Thread Pool -- 91] DEBUG o.d.p.jta.JtaTransactionManager - JTA TransactionManager found at fallback JNDI location [java:/TransactionManager]

      17:37:11,055 INFO  [stdout] (ServerService Thread Pool -- 91) 17:37:11.054 [ServerService Thread Pool -- 91] DEBUG o.d.p.jta.JtaTransactionManager - JTA TransactionSynchronizationRegistry found at default JNDI location [java:comp/TransactionSynchronizationRegistry]

      17:37:11,056 INFO  [stdout] (ServerService Thread Pool -- 84) 17:37:11.056 [ServerService Thread Pool -- 84] DEBUG o.d.p.jta.JtaTransactionManager - Unable to find transaction: {}. Might be running in CMT environmentUserTransaction

      17:37:11,061 INFO  [stdout] (ServerService Thread Pool -- 84) 17:37:11.056 [ServerService Thread Pool -- 84] DEBUG o.d.p.jta.JtaTransactionManager - No JTA TransactionManager found at fallback JNDI location [java:comp/TransactionManager]

      17:37:11,065 INFO  [stdout] (ServerService Thread Pool -- 84) 17:37:11.065 [ServerService Thread Pool -- 84] DEBUG o.d.p.jta.JtaTransactionManager - No JTA TransactionManager found at fallback JNDI location [java:appserver/TransactionManager]

      17:37:11,066 INFO  [stdout] (ServerService Thread Pool -- 84) 17:37:11.066 [ServerService Thread Pool -- 84] DEBUG o.d.p.jta.JtaTransactionManager - No JTA TransactionManager found at fallback JNDI location [java:pm/TransactionManager]

      17:37:11,066 INFO  [stdout] (ServerService Thread Pool -- 84) 17:37:11.066 [ServerService Thread Pool -- 84] DEBUG o.d.p.jta.JtaTransactionManager - JTA TransactionManager found at fallback JNDI location [java:/TransactionManager]

      17:37:11,067 INFO  [stdout] (ServerService Thread Pool -- 84) 17:37:11.066 [ServerService Thread Pool -- 84] DEBUG o.d.p.jta.JtaTransactionManager - JTA TransactionSynchronizationRegistry found at default JNDI location [java:comp/TransactionSynchronizationRegistry]

      17:37:11,087 INFO  [stdout] (ServerService Thread Pool -- 91) 17:37:11.086 [ServerService Thread Pool -- 91] DEBUG o.d.p.jta.JtaTransactionManager - No UserTransaction found at JNDI location [java:comp/UserTransaction]

      17:37:11,087 INFO  [stdout] (ServerService Thread Pool -- 91) javax.naming.NameNotFoundException: UserTransaction

       

      The persistence I used to configure JBPM persistence is as follows:

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

      <persistence version="2.0"

                   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence

                                       http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd

                                       http://java.sun.com/xml/ns/persistence/orm

                                       http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"

                   xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"

                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                   xmlns="http://java.sun.com/xml/ns/persistence">

       

       

        <persistence-unit name="org.jbpm.domain" transaction-type="JTA">

          <provider>org.hibernate.ejb.HibernatePersistence</provider>

          <jta-data-source>java:jboss/datasources/jbpmDS</jta-data-source>

              <mapping-file>META-INF/JBPMorm.xml</mapping-file>

              <mapping-file>META-INF/Taskorm.xml</mapping-file>

              <class>org.drools.persistence.info.SessionInfo</class>

              <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>

              <class>org.drools.persistence.info.WorkItemInfo</class>

              <class>org.jbpm.persistence.correlation.CorrelationKeyInfo</class>

              <class>org.jbpm.persistence.correlation.CorrelationPropertyInfo</class>

             

              <class>org.jbpm.process.audit.ProcessInstanceLog</class>

              <class>org.jbpm.process.audit.NodeInstanceLog</class>

              <class>org.jbpm.process.audit.VariableInstanceLog</class>

             

              <!-- manager -->

              <class>org.jbpm.runtime.manager.impl.jpa.ContextMappingInfo</class>

       

       

              <class>org.jbpm.services.task.impl.model.AttachmentImpl</class>

              <class>org.jbpm.services.task.impl.model.ContentImpl</class>

              <class>org.jbpm.services.task.impl.model.BooleanExpressionImpl</class>

              <class>org.jbpm.services.task.impl.model.CommentImpl</class>

              <class>org.jbpm.services.task.impl.model.DeadlineImpl</class>

              <class>org.jbpm.services.task.impl.model.DelegationImpl</class>

              <class>org.jbpm.services.task.impl.model.EscalationImpl</class>

              <class>org.jbpm.services.task.impl.model.GroupImpl</class>

              <class>org.jbpm.services.task.impl.model.I18NTextImpl</class>

              <class>org.jbpm.services.task.impl.model.NotificationImpl</class>

              <class>org.jbpm.services.task.impl.model.EmailNotificationImpl</class>

              <class>org.jbpm.services.task.impl.model.EmailNotificationHeaderImpl</class>

              <class>org.jbpm.services.task.impl.model.PeopleAssignmentsImpl</class>

              <class>org.jbpm.services.task.impl.model.ReassignmentImpl</class>

         

              <class>org.jbpm.services.task.impl.model.TaskImpl</class>

              <class>org.jbpm.services.task.impl.model.TaskDataImpl</class>

              <class>org.jbpm.services.task.impl.model.UserImpl</class>

         

              <!--BAM for task service -->

              <class>org.jbpm.services.task.audit.impl.model.BAMTaskSummaryImpl</class>

         

              <!-- Event Classes -->

              <class>org.jbpm.services.task.audit.TaskEventImpl</class>

             

              <exclude-unlisted-classes>true</exclude-unlisted-classes>

       

       

          <properties>

            <property name="hibernate.max_fetch_depth" value="3"/>

            <property name="hibernate.hbm2ddl.auto" value="update" />

            <property name="hibernate.show_sql" value="true" />

            <!-- <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />

            <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL9Dialect"/>

            <property name="hibernate.id.new_generator_mappings" value="false"/>

          -->

            <property name="hibernate.transaction.coordinator_class" value="org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorBuilderImpl" />

            <property name="hibernate.transaction.jta.platform" value="JBossAS" />

            <property name="hibernate.transaction.manager_lookup_class" value="JBossAS" />

      <!--

          <property name="hibernate.transaction.jta.platform" value="org.hibernate.engine.transaction.jta.platform.internal.BitronixJtaPlatform" />

          <property name="hibernate.transaction.factory_class" value="org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory" />

      -->    

          </properties>       

        </persistence-unit>

      </persistence>

       

      Is this a Hibernate 5 version compatibility issue?

       

      I'm doing something wrong?

       

      Many thanks in advance