Yet another Java Developer.

JSF Developer living in Oklahoma City

Gallery

details2.png IMGP0303.JPG IMGP0109.JPG IMGP0087.JPG

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.

7 Responses to “org.hibernate.HibernateException: The chosen transaction strategy requires access to the JTA TransactionManager”

  1. essnet Says:

    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. azzuwan Says:

    Thanks Greg, it works for me too

  3. Greg Says:

    I’m happy that this is useful to some people.

  4. Leandro Bortolotto Says:

    Thanks Greg and essnet, it works on glassfish v3 for me too.

  5. Robert Moore Says:

    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?

  6. Vasko Gjurovski Says:

    Robert, I have the same problem. Did you manage to find a solution for it?

  7. Zabin Says:

    Thanks Greg…. It helped a lottttttttttttttt

Leave a Reply

Spam Protection by WP-SpamFree

Sidebar3 : Please add some widgets here.