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

Written by

in

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.(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)

  

Second make sure we have following line under properties node

  

Thats it, I hope this helps someone.

Comments

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

  1. essnet Avatar
    essnet

    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 Avatar
    azzuwan

    Thanks Greg, it works for me too

    1. Greg Avatar

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

  3. Leandro Bortolotto Avatar
    Leandro Bortolotto

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

  4. Robert Moore Avatar
    Robert Moore

    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?

  5. Vasko Gjurovski Avatar
    Vasko Gjurovski

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

  6. Zabin Avatar
    Zabin

    Thanks Greg…. It helped a lottttttttttttttt

  7. Vitorino Avatar

    Man, thanks a lot! You saved me from a big headache! I really really appreciate it! Kudos for your post!

  8. Ingvar Larsson Avatar
    Ingvar Larsson

    Well, I also want to say thanks!!! Very very helpful!!

  9. Aksel Avatar
    Aksel

    Thanks!
    This saved my day!
    Im deploying on JBoss 6.0.0 Final

    1. Greg Avatar

      Happy to hear that.

  10. corota Avatar
    corota

    Thank you for your help!!

  11. Wilman Avatar

    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.

  12. Kevin Avatar
    Kevin

    yes, it helped me.
    thanks for posting.

  13. Hari Avatar
    Hari

    Thanks a lot.

  14. Vijay Jayaram Avatar
    Vijay Jayaram

    Thanks a lot Greg
    This works
    😉

  15. geeky Heather Avatar

    You are, quite literally, my hero.

  16. andrea Avatar
    andrea

    it works also on JBoss 4.2.2. Thanks!

  17. Danilo Avatar
    Danilo

    JBoss 5.1.2 and running!
    Perfect

  18. Prashant Avatar
    Prashant

    Thanks a lot…..

Leave a Reply

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