Hibernate version 3.2.0.CR2:
Hello I am getting the following exception when I try to use Hibernate on WebSphere 6.0.2.9:
Code:
org.hibernate.TransactionException: Could not find UserTransaction in JNDI:
at org.hibernate.transaction.JTATransaction.<init>(JTATransaction.java:64)
at org.hibernate.transaction.JTATransactionFactory.createTransaction(JTATransactionFactory.java:57)
at org.hibernate.jdbc.JDBCContext.getTransaction(JDBCContext.java:186)
at org.hibernate.impl.SessionImpl.getTransaction(SessionImpl.java:1308)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1318)
at rootpackage.application.business.logic.ServiceAgreementSvcBean.storeServiceAgreement(ServiceAgreementSvcBean.java:832)
... 37 more
Caused by: javax.naming.NameNotFoundException: Name "comp/UserTransaction" not found in context "java:".
at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1094)
at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:990)
at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:201)
at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:142)
at javax.naming.InitialContext.lookup(InitialContext.java:361)
at org.hibernate.transaction.JTATransaction.<init>(JTATransaction.java:60)
My SessionFactory configuration file looks as follows:
Code:
<session-factory name="java:hibernate/RootpackageEntitySessionFactory">
<!-- DBMS dialect: oracle. -->
<property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.connection.datasource">jdbc/optimalj5</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>
<property name="hibernate.current_session_context_class">jta</property>
<!-- Enable or disable SQL logging information -->
<property name="show_sql">true</property>
<!-- Cache manager -->
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<!-- Mapping files for entity module: -->
...
</session-factory>
I am aware of the former existence of this problem in Hibernate 3.0. But it appears it has been addressed:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-198.
Does anybody have a clue of what might be wrong? Shall I reopen HHH-198?
Regards,
Andrei.