Hi:
I am trying to create a sample application using hibernate-2.1, weblogic 8.1 and Oracle 8i. I have a simple java client invoking the SSB which then tries to establish a hiberante session.
the code in my SSB is :
Configuration cfg = new Configuration();
cfg.setProperty("jndi.url","t3://localhost:7001");
cfg.setProperty("jndi.class", "weblogic.jndi.WLInitialContextFactory");
cfg.setProperty("hibernate.connection.datasource", "testDataSource");
cfg.setProperty("hibernate.dialect", "net.sf.hibernate.dialect.OracleDialect");
cfg.setProperty("hibernate.show_sql", "true");
cfg.setProperty("hibernate.transaction.factory_class", "net.sf.hibernate.transaction.JTATransactionFactory");
cfg.setProperty("jta.UserTransaction", "java:comp/UserTransaction");
cfg.addClass(EasTlKeyvaluelookup.class);
/******************* this is line number 61********************/
defaultSessionFactory = cfg.buildSessionFactory();
if(defaultSessionFactory != null)
System.out.println("MADE SESSION FACTORY!!!");
else
System.out.println("could not make session factory");
session = defaultSessionFactory.openSession();
/************************ this is line number 70***************/
List myList = session.createQuery(
"from EasTlKeyvaluelookup as lookup where lookup.keyidentifier = 'EASDaemonPollInterval'"
).list();
I get the following bunch of messages :
The userid-passwd combination is correct, although there is authenication failure message.
Mar 17, 2004 1:42:22 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
WARNING: Could not obtain connection metadata
java.sql.SQLException: User: easusr01_dv, failed to be authenticated.
at weblogic.jdbc.common.internal.RmiDataSource.getSubject(RmiDataSource.java:257)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:188)
at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionPro
vider.java:56)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1119)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:748)
at hibertest.TestHibernateBean.doQuery(TestHibernateBean.java:61)
at hibertest.TestHibernate_j4ohqo_EOImpl.doQuery(TestHibernate_j4ohqo_EOImpl.java:45)
at hibertest.TestHibernate_j4ohqo_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:466)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:409)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:353)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:404)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Mar 17, 2004 1:42:22 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use scrollable result sets: false
Mar 17, 2004 1:42:22 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Use JDBC3 getGeneratedKeys(): false
Mar 17, 2004 1:42:22 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: false
Mar 17, 2004 1:42:22 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: echoing all SQL to stdout
Mar 17, 2004 1:42:22 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {no='N', true=1, yes='Y', false=0}
Mar 17, 2004 1:42:22 PM net.sf.hibernate.cfg.SettingsFactory buildSettings
INFO: cache provider: net.sf.hibernate.cache.HashtableCacheProvider
Mar 17, 2004 1:42:22 PM net.sf.hibernate.cfg.Configuration configureCaches
INFO: instantiating and configuring caches
Mar 17, 2004 1:42:22 PM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Mar 17, 2004 1:42:22 PM net.sf.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: no JNDI name configured
Mar 17, 2004 1:42:22 PM net.sf.hibernate.cache.UpdateTimestampsCache <init>
INFO: starting update timestamps cache at region: net.sf.hibernate.cache.UpdateTimestampsCache
Mar 17, 2004 1:42:22 PM net.sf.hibernate.cache.QueryCache <init>
INFO: starting query cache at region: net.sf.hibernate.cache.QueryCache
MADE SESSION FACTORY!!!
Mar 17, 2004 1:42:22 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 0, SQLState: null
Mar 17, 2004 1:42:22 PM net.sf.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: User: easusr01_dv, failed to be authenticated.
Mar 17, 2004 1:42:22 PM net.sf.hibernate.JDBCException <init>
SEVERE: Cannot open connection
java.sql.SQLException: User: easusr01_dv, failed to be authenticated.
at weblogic.jdbc.common.internal.RmiDataSource.getSubject(RmiDataSource.java:257)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:188)
at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionPro
vider.java:56)
at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:278)
at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3264)
at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3244)
at net.sf.hibernate.impl.BatcherImpl.prepareQueryStatement(BatcherImpl.java:65)
at net.sf.hibernate.loader.Loader.prepareQueryStatement(Loader.java:704)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:185)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:950)
at net.sf.hibernate.loader.Loader.list(Loader.java:941)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:834)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1512)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at hibertest.TestHibernateBean.doQuery(TestHibernateBean.java:70)
at hibertest.TestHibernate_j4ohqo_EOImpl.doQuery(TestHibernate_j4ohqo_EOImpl.java:45)
at hibertest.TestHibernate_j4ohqo_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:466)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:409)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:353)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:404)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Errornet.sf.hibernate.JDBCException: Cannot open connection
TIA
sp
|