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.
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!
Thanks Greg, it works for me too
I’m happy that this is useful to some people.
Thanks Greg and essnet, it works on glassfish v3 for me too.
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?
Robert, I have the same problem. Did you manage to find a solution for it?
Thanks Greg…. It helped a lottttttttttttttt
Man, thanks a lot! You saved me from a big headache! I really really appreciate it! Kudos for your post!
Well, I also want to say thanks!!! Very very helpful!!
Thanks!
This saved my day!
Im deploying on JBoss 6.0.0 Final
Happy to hear that.
Thank you for your help!!
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.
yes, it helped me.
thanks for posting.
Thanks a lot.
Thanks a lot Greg
This works
😉
You are, quite literally, my hero.
it works also on JBoss 4.2.2. Thanks!
JBoss 5.1.2 and running!
Perfect
Thanks a lot…..