I am trying to get Hibernate 2.1 up and running under WebSphere 5.1 (the Test Server version in WSAD). I would like to use JTA transactions. However, whenever I call one of my session EJBs, I get the following exception:
[6/24/04 15:44:47:056 PDT] 54b11b7a Helpers W NMSV0605W: A Reference object looked up from the context "localhost/nodes/localhost/servers/server1" with the name "jta/usertransaction" was sent to the JNDI Naming Manager and an exception resulted. Reference data follows:
Reference Factory Class Name: com.ibm.ejs.jts.jta.UtxJNDIFactory
Reference Factory Class Location URLs: <null>
Reference Class Name: java.lang.Object
Exception data follows:
javax.naming.ConfigurationException
at com.ibm.ejs.jts.jta.UtxJNDIFactory.getObjectInstance(UtxJNDIFactory.java:90)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:313)
at com.ibm.ws.naming.util.Helpers.processSerializedObjectForLookup(Helpers.java:884)
at com.ibm.ws.naming.jndicos.CNContextImpl.processResolveResults(CNContextImpl.java:1762)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1615)
at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1525)
at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1225)
at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:132)
at javax.naming.InitialContext.lookup(InitialContext.java:359)
at net.sf.hibernate.transaction.JTATransaction.begin(JTATransaction.java:132)
at net.sf.hibernate.transaction.JTATransactionFactory.beginTransaction(JTATransactionFactory.java:58)
at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:2227)
at com.sellcore.service.user.UserBean.createUserFromCredentials(UserBean.java:111)
at
and so on.
My hibernate.cfg.xml looks like this:
Code:
<hibernate-configuration>
<!-- a SessionFactory instance listed as /jndi/name -->
<session-factory name="hibernate/SessionFactory">
<!-- properties -->
<!--property name="connection.datasource">my/first/datasource</property-->
<property name="dialect">net.sf.hibernate.dialect.SQLServerDialect</property>
<property name="connection.username">kkeigwin</property>
<property name="connection.password"></property>
<property name="connection.url">
jdbc:microsoft:sqlserver://TEMPSERVER:1433;DatabaseName=kkeigwindb;SelectMethod=cursor
</property>
<property name="connection.driver_class">
com.microsoft.jdbc.sqlserver.SQLServerDriver
</property>
<property name="show_sql">false</property>
<property name="use_outer_join">true</property>
<property name="transaction.factory_class">
net.sf.hibernate.transaction.JTATransactionFactory
</property>
<property name="jta.UserTransaction">jta/usertransaction</property>
<!--property name="transaction.manager_lookup_class">net.sf.hibernate.transaction.WebSphereTransactionManagerLookup</property-->
<!-- mapping files -->
<mapping resource="com/sellcore/service/user/package.hbm.xml"/>
</session-factory>
</hibernate-configuration>
(Sorry if the formatting makes this hard to read.)
I have tried using the net.sf.hibernate.transaction.WebSphereTransactionManagerLookup class instead of specifying the jta.UserTransaction property, with the result being that the wrong JNDI name is used, so I think I am closer with the current config.
I have verified that the context name for UserTransaction in my appserver is correct (i.e. jta/usertransaction). But I do not know much about JNDI references, and would like to know if someone can explain why this exception is occurring.
Thanks in advance for any help.