--- Lutz Zetzsche <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Am Montag, 16. Mai 2005 16:33 schrieb Woodchuck:
> > i've read the class loader how-to and also searched the archives
> but
> > haven't found any answers for my current problem -- which is that
> my
> > application-specific jars (under WEB-INF/lib) don't seem to get
> > loaded at all.
> >
> > for instance, i have ojdbc14.jar (Oracle JDBC API) under
> WEB-INF/lib
> > but i get ClassDefNotFoundExceptions when my app is trying to
> > establish its connection pool.
> >
> > but when i place the ojdbc14.jar under common/lib my app can
> > establish the connection pool.
> >
> > there are other jars in my WEB-INF/lib like common-beanutils.jar
> and
> > such that are also not being loaded (i get same run-time errors
> when
> > accessing jsps in my app).
> >
> > does anyone have any suggestion as to why my WEB-INF/lib folder
> seems
> > to be ignored?
> >
> > the jars in WEB-INF/lib got loaded fine in Tomcat 4.1.29 and i'm in
> > the process of upgrading it to Tomcat 5.5.9.
> 
> It seems that you missed someting when reading the class loader
> how-to.
> 
> The how-to says:
> 
> (1) "Common - This class loader contains additional classes that are 
> made visible to both Tomcat internal classes and to all web 
> applications."
> 
> (2) "Shared - This class loader is the place to put classes and 
> resources that you wish to share across ALL  web applications (unless
> 
> Tomcat internal classes also need access, in which case you should
> put 
> them in the Common  class loader instead)."
> 
> (3) "WebappX - [...] All unpacked classes and resources in 
> the /WEB-INF/classes directory of your web application archive, plus 
> classes and resources in JAR files under the /WEB-INF/lib directory
> of 
> your web application archive, are made visible to the containing web 
> application, but to no others."
> 
> So, the difference between (1) and (2) plus (3) is that the Tomcat 
> internal classes have access to the files in the common directory but
> 
> not to the classes in shared or /WEB-INF/classes or /WEB-INF/lib.
> 
> I.e. your ojdbc14.jar must be visible to Tomcat internal classes. 
> Therefore it must be stored in the common directory.
> 
> 
> Best wisjes
> 
> Lutz


hihi,

i just installed Tomcat 5.0.25 and my web app works.  the database
connection pool works, and my ojdbc14.jar is *only* found under my
specific web app WEB-INF/lib folder.

however, the class loader how-to for Tomcat 5.0 is the same as Tomcat
5.5. and by this it should *not* have worked.  ie. the commons-dbcp.jar
in commons/lib should *not* have been able to find my web app's
ojdbc14.jar residing in WEB-INF/lib!

why does this inconsistency exist between the two Tomcat 5 versions
regarding this?  which one is doing the correct behavior?  why can
Tomcat 5.0 common/lib jars see application specific jars, but Tomcat
5.5  common/lib jars cannot?

the reason this is important is because of deployment.  ideally, i want
to give the client a WAR file and tell them to drop it under the
webapps folder and that's it.  i don't want to give them any other
complication such as a separate jar file to be placed in common/lib. 
(some of my clients are not technical at all, nevermind having a basic
understanding of Tomcat and how java web apps work)

moreover, by placing the ojdbc14.jar in common/lib, this means we are
forcing every web app that uses Oracle to use the same JDBC drivers. 
this should not be a problem in most cases, but my point is the lack of
flexibility on a per web app basis....


woodchuck





> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


                
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to