Hi,

I have written a small patch to address some class loading issues in
CocoonServlet.  In a previous (and rather lengthy) post on Friday I
detailed what I thought were some problems with Cocoon's
RepositoryClassLoader.  I now see that this class loader is required for
the compiling and loading of XSP pages (and other things such as the
sitemap), although I do not think this ClassLoader should be used when
user code is executed.

In my previous post, I described my reasoning for this, but the two main
reasons are that:

1) The Java API docs imply that it is a Thread's creator's
responsibility to set the ContextClassLoader (CocoonServlet does this
inappropriately, I believe), and;

2) When Cocoon sets its own ClassLoader as ContextClassLoader, this
breaks Tomcat's JNDI implementation because of the way Tomcat ties
Environment Naming Contexts to ClassLoaders (see my previous post)

Although it is my personal opinion that Cocoon shouldn't be setting the
ContextClassLoader at all, my patch checks to make sure the
"init-classloader" param is set to true before it does so.  Right now,
CocoonServlet ignores this parameter with a note in the code saying
"HACK for reducing class loader problems."  -- which, I was also
wondering if someone could elaborate on what kind of problems are being
referred to here?

I see that BootstrapServlet does the same thing, except with
ParanoidClassLoader, but I've left this alone for now.

I'd like some feedback, and if positive, I will go ahead and submit my
patch to Bugzilla. :-)

Thanks,

David


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to