cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@s-und-n.de>
Subject RE: CocoonSerlvet Patch (init-classloader param)
Date Thu, 06 Jun 2002 12:31:37 GMT
Hi David,

>
> 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 don't now the problem, but as far as I can tell, the init-classloader
param is evaluated. In CocoonServlet, line 306 (current CVS):
        this.addClassDirs = "true".equalsIgnoreCase(value) ||
"yes".equalsIgnoreCase(value);

and this boolean is used at several places throughout the servlet class.

So, what does your patch change?

Carsten

>
> 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: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message