-->
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.  [ 6 posts ] 
Author Message
 Post subject: Error in connectiog Hibernate3 + Oracle 9
PostPosted: Mon Oct 24, 2005 1:21 am 
Newbie

Joined: Mon Oct 24, 2005 12:56 am
Posts: 2
Hi All,
I am getting problem in connection Hibernate to Oracle9i datasource configured in weblogic. I am using session bean with hibernate in my application.

Following are the other details :

Hibernate version : hibernate3.jar

Mapping documents : hibernate.cfg.xml

<property name="connection.datasource">UniteDataSource</property>
<property name="jndi.url">jdbc:bea:oracle://160.110.231.98:1521
</property>
<property name="hibernate.connection.username">scott</property>
<property name="hibernate.connection.password">tiger</property>
<property name="show_sql">true</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect </property>
<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory
</property>
<property name="transaction.manager_lookup_class">
org.hibernate.transaction.WeblogicTransactionManagerLookup
</property>

Code between sessionFactory.openSession() and session.close():

Session aSession = HibernateUtil.getSessionFactory().getCurrentSession();

Full stack trace of any exception that occurs:
ExRem: setSessionContext(...)
ExRem: ejbCreate()
Inside getPersons () :
weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Unknown QOS for pro
tocolNumber: '9' ]
at weblogic.protocol.Protocol.getQOS(Protocol.java:215)
at weblogic.rjvm.ServerURL.getFinder(ServerURL.java:169)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:125)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:296)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:239)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
extFactory.java:135)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
62)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at org.hibernate.util.NamingHelper.getInitialContext(NamingHelper.java:2
8)
at org.hibernate.transaction.JTATransactionFactory.configure(JTATransact
ionFactory.java:34)
at org.hibernate.transaction.TransactionFactoryFactory.buildTransactionF
actory(TransactionFactoryFactory.java:51)
at org.hibernate.cfg.SettingsFactory.createTransactionFactory(SettingsFa
ctory.java:366)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:
120)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1463
)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
a:1004)
at test.util.HibernateUtil.<clinit>(HibernateUtil.java:15)
at test.session.DomainManagerBean.getPersons(DomainManagerBean.java:67)
at test.session.DomainManager_9igdcg_EOImpl.getPersons(DomainManager_9ig
dcg_EOImpl.java:202)
at test.session.DomainManager_9igdcg_EOImpl_CBV.getPersons(Unknown Sourc
e)
at jsp_servlet._jsp.__index._jspService(index.jsp:25)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
(ServletStubImpl.java:971)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:402)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:446)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
n.run(WebAppServletContext.java:6350)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
dSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:3635)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2585)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Initial SessionFactory creation failed.weblogic.utils.AssertionError: ***** ASSE
RTION FAILED *****[ Unknown QOS for protocolNumber: '9' ]


Name and version of the database you are using: Oracle 9i


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 24, 2005 9:40 am 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Quote:
<property name="jndi.url">jdbc:bea:oracle://160.110.231.98:1521
</property>

isn't url for oracle
you have to use like this
Quote:
<property name="jndi.url">jdbc:oracle:thin:@160.110.231.98:1521:ORCL
</property>


where ORCL is your database identifier (SID)


Top
 Profile  
 
 Post subject: Hibernate + Weblogic datasource connection problem
PostPosted: Thu Oct 27, 2005 12:45 am 
Newbie

Joined: Mon Oct 24, 2005 12:56 am
Posts: 2
Can any one help me out. My problem is still not resolved.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 27, 2005 5:21 am 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
do you check url ? - what is your jdbc driver ?
I don't know what is jdbc driver on weblogic, but if you use oracle jdbc driver url isn't good

your url isn't good for any jdbc driver, because url have to have host,port i SID
your url haven't SID


Top
 Profile  
 
 Post subject: Oracle 10G and OC4J Application Server
PostPosted: Tue Nov 01, 2005 11:57 pm 
Newbie

Joined: Tue Nov 01, 2005 11:41 pm
Posts: 3
Hi I'm fairly new to hibernate but so far set up has been a breeze. Anyway I've been frustrated trying to figure out why it cannot see my datasource name. If I try and use a datasource name it throws an exception saying the name doesn't exist every time.

Below is a sample of my datasource name

hibernate.connection.datasource = java:/comp/env/jdbc/OrdManDS

I am very familiar with setting up oc4j which is basically orion web server and have the init of hibernate in my startup ...and this works perfectly so I know the datasource is set properly:

javax.naming.Context ctx = new javax.naming.InitialContext();

javax.sql.DataSource ds = (DataSource)ctx.lookup("java:/comp/env/jdbc/OrdManDS");


I have tried just the following also:
hibernate.connection.datasource =jdbc/OrdManDS

and placing the setup of the com.evermind.server.ApplicationInitialContextFactory it the hibernate settings also

It also throws exception saying it cannot find the name.

My database is Oracle 10G 10.1.2, Hibernate3 rc1

I will try switching to rc2 to see if anything changes ...is there something I am doing wrong? Thanks for any help


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 02, 2005 7:01 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Look at the code, this is what Hibernate does
Code:
String jndiName = props.getProperty(Environment.DATASOURCE);
...
ds = (DataSource) NamingHelper.getInitialContext(props).lookup(jndiName);

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.