-->
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.  [ 2 posts ] 
Author Message
 Post subject: using weblogic datasource. Hibernate 3.2.3 and hibernate 3.0
PostPosted: Fri Apr 27, 2007 3:21 am 
Newbie

Joined: Fri Apr 27, 2007 3:03 am
Posts: 3
Hi All,

We were using hibernate 3.0.5 and now we are trying to upgrade that to 3.2.3.
The hibernate.properties is configured to use a weblogic data source as given below.


hibernate.connection.datasource test.ds
hibernate.jndi.class weblogic.jndi.WLInitialContextFactory
hibernate.dialect org.hibernate.dialect.Oracle9Dialect


#Other key values
hibernate.show_sql false
hibernate.jdbc.batch_size 0
hibernate.jdbc.use_streams_for_binary true
hibernate.use_outer_join true
audit true
hibernate.query.substitutions true '1', false '0', yes 'Y', no 'N'
hibernate.query.imports org.hibernate.test, org.hibernate.eg, com.db.entity

I am initializing the SessionFactory using configuration.buildSessionFactory();
After passing the properties object which contains the hibernate.properties


Now this used to work fine with the version 3.0.5. But on using
the 3.2.3 version of hibernate when i am doing the same,its giving
the error.. Could anyone please help .. Thanks in Advance.

Renjith


Here is the exception stack trace...


- JNDI InitialContext properties:{java.naming.factory.initial=weblogic.jndi.WLIn
itialContextFactory}
- Using datasource: test.ds
- Could not obtain connection metadata
java.sql.SQLException: User: test, failed to be authenticated.
at weblogic.jdbc.common.internal.RmiDataSource.getSubject(RmiDataSource.
java:264)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSour
ce.java:195)
at org.hibernate.connection.DatasourceConnectionProvider.getConnection(D
atasourceConnectionProvider.java:66)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:
84)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009
)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1292)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 27, 2007 6:57 am 
Newbie

Joined: Fri Apr 27, 2007 3:03 am
Posts: 3
Hi all,

Found the issue. The entity classes jar had one hibernate.properties in the root folder which contained the development data base's user name and password -> which was loaded as global properties and the application specific one was loaded from a URL explicitly while the configuration was initialized. So this user name and password was causing the problem as it tries to obtain the connection using this user name and password.

So if I am loading the hibernate.properties explicitly from a URL, and if there is another hibernate.properties in the classpath both are supposed to be getloaded? Is this how hibernate is supposed to behave?

Regards
Renjith


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

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.