cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: ClassLoading and Cocoon 2
Date Wed, 14 Feb 2001 11:33:08 GMT
[brought Craig into the discussion since he's the classloading guru
around here]

Berin Loritsch wrote:
> 
> Does anyone know how to selectively load classes from a parent ClassLoader?
> 
> I recently made Cocoon live inside it's own ClassLoader.  This is a good thing
> as it protects us from a myriad of issues with IBM WebSphere and other Servlet
> Containers that have wacky ClassLoaders.  However, the one thing it does not
> protect us from is XML Parser conflicts.  If we can resolve against the Servlet
> Engine's classes for things like javax.servlet.* and Enterprise applications,
> but not anything else, then we are just about there.

I don't understand what you mean by parser conflicts in this case: if
Cocoon has its own classloader and delegates to the parent only when it
doesn't find its classes (just like Catalina does) there is no conflict.
What am I missing?
 
> One way is to explicitly handle the Parent ClassLoader separately from the
> way the URLClassLoader handles it.  In other words, it always checks in the
> current ClassLoader first (this does not seem to be happening), and then
> it checks in the parent ClassLoader.

Yeah, I thought Catalina used this approach, isn't it Craig?
 
> Another approach is to separate out the CocoonServlet classes from the main
> Cocoon.jar and have all the specific Cocoon libraries in a non traditional
> location--this may be easier to implement.
> 
> Example:
> --------
> 
> WEB-INF/lib
>          /avalon-api.jar
>          /cocoon-servlet.jar
> 
> WEB-INF/cocoon-lib
>          /Xerces_1_2_3.jar
>          /cocoon.jar
> ....
> And all the other libs
> 
> The approach would require making an Interface that would be in
> cocoon-servlet.jar that would allow us to send requests to the
> propper Cocoon class.  It would also force us to include the
> ClassLoader in there.
> 
> This keeps Cocoon almost completely isolated, and enforces the
> ClassLoader to be used.

Yuck. I vote for implementing a better classloader (even borrowing
Catalina's code if possible).

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------



Mime
View raw message