On Fri, 2 Nov 2001, Frank Lawlor wrote:

> Date: Fri, 2 Nov 2001 13:20:07 -0600
> From: Frank Lawlor <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>,
>      [EMAIL PROTECTED]
> To: 'Remy Maucherat' <[EMAIL PROTECTED]>,
>      "Tomcat (E-mail)" <[EMAIL PROTECTED]>
> Subject: RE: The Infamous ClassCastException Problem
>
> > This is normal then. Class foo loaded by class
> > loader A is not castable to class foo loaded
> > by class loader B (if they are really independent,
> > of course - if A is the parent of B and B
> > delegates, it will work). You have to
> > put the class in a spot shared by both
> > webapps (that means the shared class loader.
> >
> > Remy
>
> Then how does this work in a general client-
> server relationship such as RMI servers, EJB
> servers, etc.  Don't they usually just give
> you a jar with the classes that you add to
> your client?
>

> Having to use the exact same file seems
> excessive???!  Isn't there some way to allow
> use of a copy of the class?
>

The only way to use one copy of a class between webapps is to put that
class in a *parent* classloader -- for Tomcat, that means put the shared
class in the "lib"  directory, which is loaded into a classloader that is
the parent of the webapp class loader for each app.

For more info on class loading in Tomcat, see:

http://jakarta.apache.org/tomcat/tomcat-4.0-doc/class-loader-howto.html

>  -- Frank
>

Craig


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to