Hi,
I'm having a problem with a MDB running on an IBM AIX machine with websphere 5.1.1.3 and hibernate 3.
Here's a snippet from my hibernate.properties file:
# Datasource from JNDI
hibernate.connection.datasource = jdbc/interfacePool
# Hibernate TransactionFactory
# 1. delegates to JTA (if an existing transaction is underway the Session performs its
# work in that context, otherwise a new transaction is started)
hibernate.transaction.factory_class = org.hibernate.transaction.JTATransactionFactory
hibernate.transaction.flush_before_completion true
hibernate.transaction.auto_close_session true
#jta.UserTransaction=jta/usertransaction
jta.UserTransaction=java:comp/UserTransaction
# Hibernate Transaction Manager Lookup Class
#hibernate.transaction.manager_lookup_class = org.hibernate.transaction.WebSphereTransactionManagerLookup
hibernate.transaction.manager_lookup_class = org.hibernate.transaction.WebSphereExtendedJTATransactionLookup
My code is as follows:
Session session = HibernateUtil.currentJTASession();
// This method simply gets the SessionFactory and then calls getSessionFactory().getCurrentSession();
The stack trace is as follows:
[2005-09-22 15:41:02,224] MessageListenerThreadPool : 0 org.hibernate.connection
.DatasourceConnectionProvider FATAL - Could not find datasource: jdbc/interfaceP
ool
java.lang.ClassCastException: com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource
at org.hibernate.connection.DatasourceConnectionProvider.configure(Datas
ourceConnectionProvider.java:44)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvi
der(ConnectionProviderFactory.java:80)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFa
ctory.java:349)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:
58)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1509
)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1054)
at com.sscims.hibernate.util.HibernateUtil.setSessionFactory(HibernateUt
il.java:66)
at com.sscims.hibernate.util.HibernateUtil.getSessionFactory(HibernateUt
il.java:118)
at com.sscims.hibernate.util.HibernateUtil.currentJTASession(HibernateUt
il.java:187)
at com.sscims.tmv.interfaces.ejb.TRAMInterfaceBean.onMessage(TRAMInterfa
|