2 Replies Latest reply on Aug 2, 2007 3:49 AM by mailinator

    JBPM Process Instance - Could not enlist in transaction on e

      Hi,

      i'm using jbpm to work with workflows.
      Here is my problem :
      i'm deploying my process definition fine with the plugin. I check in the database and everything is fine.
      But when trying to acces that process definition from my webapp, i encounter some issues.

      I believe that this is because of misconfiguration of either datasources or transaction manager.
      Sadly i dont know enough to find some solution to that.

      Here is my jbpm code :

      JbpmConfiguration jbpmConfiguration=JbpmConfiguration.getInstance();
      JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
      try {
      String processName = "Acces";
      ProcessInstance processInstance = jbpmContext.newProcessInstance(processName);
      } finally {
      jbpmContext.close();
      }

      In my jbpm-ds.xml :



      <local-tx-datasource>
      <jndi-name>JbpmDS</jndi-name>
      <connection-url>jdbc:oracle:thin:@srvsa.ne:1521:dbp</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>bbbbb</user-name>
      bbbbb
      <min-pool-size>1</min-pool-size>
      <max-pool-size>5</max-pool-size>
      <idle-timeout-minutes>0</idle-timeout-minutes>
      </local-tx-datasource>



      In the logs of JBOSS, i have this :

      11:43:19,872 INFO [TransactionFactoryFactory] Using default transaction strateg
      y (direct JDBC transactions)
      11:43:19,887 INFO [TransactionManagerLookupFactory] No TransactionManagerLookup
      configured
      (in JTA environment, use of read-write or transactional second-level
      cache is not recommended)
      11:43:19,887 INFO [SettingsFactory] Automatic flush during beforeCompletion():
      disabled

      I believe there is a link between this and my exception :

      org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: a623635:94c:46adb26e:56 status: ActionStatus.ABORT_ONLY >)
      org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:343)
      org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnectManagedConnection(BaseConnectionManager2.java:518)
      org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:399)

      Does anyone know about this ?

      Regards,

      O.M.

        • 1. Re: JBPM Process Instance - Could not enlist in transaction

          The only reasons the hibernate.cfg.xml file wouldn't be found is if there's another one on your classpath, or if jbpm.cfg.xml is pointing at another file.

          How do you know it's not being found?

          Go to your local bookstore and read the new Hibernate book chapter on configuration. Or browse online, but that's so old-school ;-) You need to get some background so that you know what you're doing.

          For myself, I'm using a Oracle via a jndi datasource under WebLogic:

          <!-- DataSource properties (begin) -->
           <property name="hibernate.connection.datasource">jbpmDataSource</property>
           <!-- DataSource properties (end) -->
          
          and the Weblogic transaction manager:
           <!-- JTA transaction properties (begin) -->
           <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
           <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
           <!-- JTA transaction properties (end) -->
          


          -Ed Staub


          • 2. Re: JBPM Process Instance - Could not enlist in transaction

            Hi Ed,

            thanks for helping.

            I think that the file is not found or used because of the logs :
            No TransactionManagerLookup configured although i have those lines in my config file :

            <!-- JTA transaction properties (begin) -->
            <property name=hibernate.transaction.factory_class>org.hibernate.transaction.JTATransactionFactory
            <property name=hibernate.transaction.manager_lookup_class>org.hibernate.transaction.JBossTransactionManagerLookup
            <!-- JTA transaction properties (end) -->

            I'm using a oracle database with jboss (i failed to make it running on weblogic :( )

            I found a way to make the exception disappear (i add a <property name=com.arjuna.ats.jta.allowMultipleLastResources value=TRUE> in jbossjta-properties.xml but i believe its not the solution for long run)

            Regards,

            O.M.