Yet another Java Developer.

JSF Developer living in Oklahoma City

Gallery

options2.png IMGP0089.JPG options.png IMGP0314.JPG

Archive for February 5th, 2010

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.

Sidebar3 : Please add some widgets here.