commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephen Westbom <swest...@yahoo.com>
Subject Re: [DBCP] getting the underlying result set for Blob processing
Date Tue, 11 Feb 2003 20:23:00 GMT
Helpful class loader info.

The common/lib jar is in the classpath of the system class loader (called after
the boostrap class loader based on your JVM's classpath.  The WEB-INF/lib has
an application specific class loader (this is why applications can be
independent from each other within a web container).  The WAR's class loader is
a child node of the parent, the system class loader.  

A child class loader such as your WAR uses always defers class loading to the
parent, if the parent cannot find the class then the child tries on down the
chain.

If you want the same versions of commons-dbcp and commons-pool to be used
across all applications within your Tomcat instance put them in common/lib
otherwise remove them from there and put them in the WEB-INF/lib directory as
part of your deployment.

There can also be visibility issues between parent and child class loaders. 
The parent class loader will not see child classes if they are not in its class
path, so a class loaded by a parent object using the parent's class loader may
try to load a class that only exists in the child class loader's class path and
not find it.  This is a fairly frequent problem for services.

I hope this helps you understand the way class loaders work in web containers. 
It should help when you run into this type of problem again (believe me you
will).




--- Kevin HaleBoyes <kzboyes@yahoo.com> wrote:
> --- "Craig R. McClanahan" <craigmcc@apache.org> wrote:
> >
> > Struts 1.1b3 already has the patched version of DelegatingResultSet
> > in it.
> > I would put copy both commons-dbcp and commons-pool to make sure
> > they are
> > in synch, although I don't anticipate problems.
> 
> Just to make sure I understand correctly.  Take the commons-dbcp and
> commons-pool from the Struts 1.1b3 (already in my WEB-INF/lib
> directory) and copy them to CATALINA_HOME/common/lib.
> 
> Thanks,
> Kevin.
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Shopping - Send Flowers for Valentine's Day
> http://shopping.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

Mime
View raw message