-->
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: What jar required in WEB-INF/lib ?
PostPosted: Fri Nov 07, 2003 11:06 am 
Newbie

Joined: Fri Nov 07, 2003 10:58 am
Posts: 14
Location: Albuquerque, NM
Are are using Tomcat 4.1.27 and Oracle 8 and are developing servlet based applications.

We have lots of apps that share the base set libraries (JARs). We classically put our library jars (this includes Oracle, Tapestry, etc.) in <TOMCAT>/shared/lib (plus the Oracle jar goes in <TOMCAT>/common/lib).

After much experimentation, I finally determined that hibernate2.jar MUST live in <TOMCAT>/webapps/<webapp>/WEB-INF/lib -- it cannot live in shared/lib. If it is in shared/lib, Hibernate cannot find the hibernate.cfg.xml or <table>.hbm.xml files.

What is up with this? Why must hibernate2.jar live in WEB-INF/lib? All of Hibernate's support jar files can live in <TOMCAT>/shared/lib, only hibernate2.jar seems "special". This is the first jar I have ever come across that seems special in this way at this point.

I finally have Hibernate "running". How if I can figure out why Hibernator seems brain damaged I will be happy, but, that is a topic for another forum.

Thanks for your help.
Kevin


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 07, 2003 4:19 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
It is due to classloader strategy "ask parent first"
common/lib stuffs are loaded by a parent classoader of the webapp.
This parent classloader cannot see child classloader classpath.

When loading resources, hibernate use the classloader which load hibernate classes, so it cannot find config files.

It may have been better to use the thread context classloader to load those resources. But changing it now would hurts lots of people.

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: What jar required in WEB-INF/lib ?
PostPosted: Sat Nov 08, 2003 5:00 pm 
Regular
Regular

Joined: Fri Sep 05, 2003 12:01 am
Posts: 80
Location: Bogot
kdorff wrote:
This is the first jar I have ever come across that seems special in this way at this point.


Have you also used struts? It has this same problem!

_________________
Mauricio Hern


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.