-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: MDB can't find datasource with Websphere and Hibernate 3
PostPosted: Fri Sep 23, 2005 4:58 pm 
Newbie

Joined: Tue Jan 11, 2005 2:26 pm
Posts: 15
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.