org.hibernate.HibernateException: The chosen transaction strategy requires access to the JTA TransactionManager

While setting up a simple web app on JBoss 5 using container manager transaction I run into following exception

Caused by: org.hibernate.HibernateException: The chosen transaction strategy requires access to the JTA TransactionManager
	at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:361)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)

Well after some research I figured out that the cause of this were two simple configuration options in persistence.xml

First we need to make sure we are using JTA as transaction-type (by default)

  <persistence-unit name="PU_NScaffold" transaction-type="JTA">

Second make sure we have following line under properties node

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

Thats it, I hope this helps someone.

20 thoughts on “org.hibernate.HibernateException: The chosen transaction strategy requires access to the JTA TransactionManager”

  1. I used this tip with GlassFish v3 bundle with Netbeans and changed hibernate.transaction.manager_lookup_class value to org.hibernate.transaction.SunONETransactionManagerLookup. Problem solved! Thanks!

  2. Thanks also (on glassfish v3). I’m doing the tutorial for Wicket+JPA but now have another Hibernate problem: The CustomerJpaController.getCustomerCount() causes an exception—
    java.lang.AbstractMethodError:
    org.hibernate.ejb.EntityManagerImpl.getCriteriaBuilder()Ljavax/persistence/criteria/CriteriaBuilder;
    Strangely enough, my first build used EclipseLink and encountered the same problem (so I rebuilt with Hibernate)
    Running with JDk1.5, NB 6.8, and glassfish V3. Will provide glassfish log if needed.
    Any thoughts?

  3. Thanks,

    This saved my file configs to integration with other modules without affecting any of them with RESOURCE_LOCAL. Projects jbpm5.1 with jbosssa 5.1, postgres 9.0.

Leave a Comment

Your email address will not be published. Required fields are marked *