-->
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.  [ 5 posts ] 
Author Message
 Post subject: Weird issues running Hibernate with Weblogic Clustering
PostPosted: Fri Mar 05, 2004 3:58 pm 
Beginner
Beginner

Joined: Mon Dec 01, 2003 8:48 pm
Posts: 47
Location: Texas, United States
I am using the latest Hibernate, Oracle 9i database and Weblogic 8.1 SP2 running on Windows 2003 Server, using BEA Jrockit JVM

I'm not sure if this is a Hibernate issue or not, but myself and BEA support so far cannot find the problem.

Basically, I am running four managed weblogic servers, two on each machine, as one cluster.

The two managed servers running on the machine with the admin server are able to persist using hibernate.

The problem is that the two instances on the second machine(which is not running an admin server) cannot find the XML mapping file. The applications are identical. When the serevers starts up, I am initializing 10 EJB's in the pool, and that is where the exception is being thrown.
net.sf.hibernate.MappingException: Resource: CommonLogEvent.hbm.xml not found
at net.sf.hibernate.cfg.Configuration.addClass(Ljava.lang.Class;)Lnet.sf.hibernate.cfg.Configuration;


Keep in mind that the same app is deployed on all servers, but only the remote servers cannot find the mapping file.

Here's the Java code:
try {
Properties props = new Properties();
props.load(this.getClass().getClassLoader().getResourceAsStream(
"properties/hibernate.properties"));
Configuration config = new Configuration();
config.setProperties(props);
config.addClass(CommonLogEvent.class);
sessionFactory = config.buildSessionFactory();
} catch (IOException io) {
io.printStackTrace();
} catch (HibernateException ex) {
ex.printStackTrace();
//hande exception
}


Should I try to load the config file some other way? Any help would be appreciated. This screams of an environemntal problem, but who knows if Weblogic clustering isn't causing this somehow.

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 05, 2004 10:49 pm 
Newbie

Joined: Wed Jan 07, 2004 1:56 pm
Posts: 14
Where is your mapping file - how have you deployed it?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 08, 2004 12:17 pm 
Beginner
Beginner

Joined: Mon Dec 01, 2003 8:48 pm
Posts: 47
Location: Texas, United States
Yes, I have deployed my mapping file to the ejb-jar file that uses it.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 17, 2004 11:37 pm 
Beginner
Beginner

Joined: Thu Jun 17, 2004 11:25 pm
Posts: 21
Location: Los Angeles
Any progress on this? I'm wondering if the problem is that the SessionFactory was replicated across the cluster by Weblogic, which is probably not supported by Hibernate.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 18, 2004 9:55 am 
Newbie

Joined: Tue Jun 15, 2004 10:45 am
Posts: 18
Location: Boston, USA
I am not sure if in your situation you can do this but:

I currently have a very similar environment as yourself but the big difference is that all the *-ejb.jar files are packaged into a single .ear file with the hibernate.cfg.xml residing in the APP-INF/classes directory (as this is considered the classes root dir in an ear).

Hibernate happily loads the cfg file through the standard new Configuration.configure.buildsessionFactory() approach.

FYI I have posted some trials and tribuation information re using Hibernate in Weblogic that may be useful

http://blogs.mit.edu/qwall/posts/615.aspx

good luck!

_________________
Quinton Wall

"The most difficult thing in the world is to know how to do a thing and to watch somebody else doing it wrong,without comment" -
- T.H. White


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