Carl Rosenberger wrote:
> 
> Geir Magnusson wrote:
> > > > > > When adding c:\java\my-web-app-dir\web-inf\classes to CLASSPATH
> > > > > > Tomcat is loosing the jars in my
> c:\java\my-web-app-dir\web-inf\lib
> > > > >
> > > > > Two workarounds were possible:
> > > > > - ..\project-dir\web-inf\classes added to the CLASSPATH
> > > > > - placing all Jars in ..\project-dir\web-inf\lib
> >
> > The reason is that you want to be able to partition your applications in
> > the servlet runner, to avoid classname clashes (each webapp can have
> > their own classes w/o worrying if another webapp uses the same
> > classname).  It also means that support packages, like jdbc drivers and
> > other utilities your webapp may use can be upgraded or changed for one
> > webapp w/o affecting any others.
> 
> Thanks a lot for this excellent explanation. You changed my opinion. It's
> not a bug, it's a feature. :-)

It is by design.  However, the 'look up' or 'delegate, then find' 
aspect can be problematic.  It comes from standard Java classloader
behavior, motivated in part by security - it prevents a classloader
below you from replacing something from the JDK, for example.

I believe that in the Servlet 2.3 spec (Tomcat 4 is the RI), the
classloader behavior is modified in the case of webapps.  I think it's
'find, then delegate' model.

geir

-- 
Geir Magnusson Jr.                           [EMAIL PROTECTED]
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!

Reply via email to