tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Isaacs <Larry.Isa...@sas.com>
Subject RE: Classloader question
Date Tue, 07 May 2002 12:17:44 GMT
The classloader diagram is found at:

<http://jakarta.apache.org/tomcat/tomcat-3.3-doc/tomcat-ug.html#configuring_classes>

Because Tomcat 3.3.x uses the JDK delagation model for
classloading, classes in the "apps" classloader take priority
over WEB-INF/classes and WEB-INF/lib.  I don't think your
approach will work because of this.

However, there is an alternate trick that might work if you want
to give it a try.  Instead of placing the "shared" classes in the
"apps" class loader, place them somewhere else and "include" them
in the webapp class loader using the additionalJars attribute of
the LoaderInterceptor11.  See:

<http://jakarta.apache.org/tomcat/tomcat-3.3-doc/serverxml.html#LoaderInterceptor11>

I believe the additionalJars attribute will take directories as
well as jars.  I also believe the "additionalJars" will be
searched after WEB-INF/classes, so a different version of a
class in WEB-INF/classes will take priority over classes added
by "additionalJars".

Cheers,
Larry


> -----Original Message-----
> From: tamir [mailto:tamir@movious.com] 
> Sent: Tuesday, May 07, 2002 4:06 AM
> To: 'Tomcat Users List'
> Subject: RE: Classloader question
> 
> 
> Hi,
> I had many problems with classloaders using tomcat 3.3.1.
> I think you shouldn't be suprised by the LinkageError, cause 
> you actually
> load this class twice, once by the context class loader and 
> second by the
> apps
> class loader.
> What I don't remember is the hirarcy between these two class loaders
> (maybe you can check in the archives, and understand better what's
> happening).
> What I don't understand is why using two different versions 
> of the same
> class.
> Isn't it some kind of troublemaker?
> 
> Tamir
> 
> 
> 
> -----Original Message-----
> From: Mario Felarca [mailto:gennadius@yahoo.com]
> Sent: Tuesday, May 07, 2002 7:06 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Classloader question
> 
> 
> Hello,
> 
> I have a situation with Tomcat 3.3a where I am trying
> to allow a specific servlet context to load a version
> of a class from within their WEB-INF/classes
> directory, while other contexts on the server use a
> different version of that class that is loaded by the
> apps classloader.
> 
> I can currently get the context classloader to
> actually load the correct class, however later on
> during init, I am getting a java.lang.LinkageError
> saying that the specific class that is being loaded
> twice is violating the loader constraints.
> 
> Can anyone point me to any resources that would help
> me solve this problem? Any similar experiences or
> ideas would be greatly appreciated.
> 
> Thanks in advance,
> 
> Mario-
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com
> 
> --
> To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:   
> <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <mailto:tomcat-user-help@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message