> > My understanding is, that the DB2 JDBC driver is loaded by the
> > webapplication. However once the commons-dbcp.jar from the common/lib
> > dir has been loaded and utilized then all at a sudden shared/lib
> > seems no longer part of the searchpath. But when commons-dbcp.jar
> > is taken from the webapps lib dir then shared/lib obviously still
> > is in the search path.
> >
> >
> > Is this intended ?
>
> Well, it is definitely a consequence of the way that the class loaders are
> architected in Tomcat.  See:
>
>   http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

The key detail to know about Tomcat classloaders is that they are in a
heirarchy, and as Craig mentioned, those higher up in that heirarchy can not
load classes "below" them.

Normally this is not a problem but for some classes that use some kind of
reflective mechanism to load classes, this can be a real concern.

Specifically, you must be careful with any classes that load other classes
"by name", either directly or by "figuring it out" or through an XML file.
Basically, any class that loads another class that wasn't referenced at
compile time will this rear its ugly head.

Once you're comfortable and conscious of this heirarchy and this detail with
dynamic classes, your classloading life will get MUCH easier.

Unfortunately, as good as the HOWTO is, it doesn't really hilight this point
about dynamic classes.

Regards,

Will Hartung
([EMAIL PROTECTED])




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

Reply via email to