1 Reply Latest reply on Jan 4, 2011 11:51 AM by bviveiros

    hibernate transaction factory class gives error jboss 5.1

    pratap_184

      Hello all ,

       

      I am using hibernate in my application and in hibernate.cfg.xml file I mentioned these properties 

       

      <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
      <property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
      and when running the application in jboss 5.1 ,it gives me the following error.
      12:50:59,252 WARN  [loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] [com.arjuna.ats.internal.jta.transaction.arjunac
      ore.lastResource.disallow] Adding multiple last resources is disallowed. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$Local
      XAResource@6a1acb
      12:50:59,346 WARN  [UserTransactionRegistry] Error notifying listener org.jboss.resource.connectionmanager.CachedConnectionManager@256b49 of userTransactio
      nStarted
      javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: ac012
      26:775:4c7cac33:6b status: ActionStatus.ABORT_ONLY >
              at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener$TransactionSynchronization.checkEnlisted(TxConnectionManager.
      java:879)
              at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:675)
              at org.jboss.resource.connectionmanager.TxConnectionManager.transactionStarted(TxConnectionManager.java:394)
              at org.jboss.resource.connectionmanager.CachedConnectionManager.userTransactionStarted(CachedConnectionManager.java:350)
      but the above code works fine in jboss 4.x. So what changes I need to do in hibernate.cfg.xml file in order to work it in my application.
      Please suggest the solution for it or if any another way to use the JTA transactions Please suggest that also.