-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate and Weblogic 8
PostPosted: Tue Mar 08, 2005 7:19 pm 
Newbie

Joined: Tue Mar 08, 2005 6:53 pm
Posts: 8
Hibernate version: 2.1

Code between sessionFactory.openSession() and session.close(): I haven't gotten to that yet. Problem obtaining Session Factory with JNDI

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

My question is regarding where to place hibernate.cfg.xml. I'm deploying a Jar on Weblogic 8 and I'd like to deploy this XML in my Jar file, the problem is that I have no clue as to where to place it for the container to detect it.

Thanks in advance


Top
 Profile  
 
 Post subject: Put it in the jar
PostPosted: Wed Mar 09, 2005 4:28 am 
Newbie

Joined: Wed Mar 09, 2005 4:25 am
Posts: 9
Location: Hamburg, Germany
.. and configure Hibernate via a URL.

URL configureFileURL = MyClass.class.getRessource("/hibernate.cfg.xml")
Configuration config = new Configuration();
config.configure(configureFileURL)

It will search for hibernate.cfg.xml, it should be placed in the root of the jar.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 09, 2005 6:28 pm 
Newbie

Joined: Tue Mar 08, 2005 6:53 pm
Posts: 8
Thanks afleischer, this works perfectly.

I was wondering, though. What's the use in defining a JNDI name for the session factory. I havn't been able to obtain it through JNDI, I had to do it through the Configuration class. Any ideas on the subject?

Thanks.


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