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.