cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: avalon.ComponentNotAccessibleException
Date Thu, 14 Sep 2000 13:31:04 GMT
Sebastien Sahuc wrote:
> I got the EXACT same problem by using Tomcat 3.3dev anf putting all
> cocoon jar in web-inf/lib.

yes, Pier and I are currently chasing this down, stay tuned for news.

> Didn't try by setting a global classpath, I switched back to resin !

If you place everything in the system classpath it works, but this is
NOT what we want: we want classpath-free installation. Drop the
Cocoon.war and you're done. Period. Nothing more. Nada. Zip.
> It seems at least that the error message isn't explicit enough. There
> should be somehow a short explanation on which compoenent it failed to
> load instead of a [null, null]... :-)

I feel bad to say this... but Ricardo's way of catching exception is a
total nightmare... I need to go thru all of C2 code to create a solid
exception handling framework... we can't continue to catch exception and
rethrow them encapsulated , this is plain silly.

> BTW Has someone succeeded in putting all the cocoon's jar into the
> web-inf/lib place ? 

As far as I can tell, this is currently IMPOSSIBLE due to javac
"internal" usage of classloading capabilities.

> If so which Servlet container is it ?

It's a problem with javac, not with the servet container.
> All the best,
> Sebastien
> Stephano, good luck with your classLoader problem... I believe that the
> more will move forward the more we will get these ClassLoader issues....

No, Catalina's classloader intrastructure is very well designed.. the
problem is that it's very "rare" that people write their own
classloaders. So far I encountered two big problems:

 - IBM 1.3 on linux has problems with java.util.ResourceBundle if you
use your own classloader

 - javac seems to use getSystemResource() instead of getResource() and
then jumps around your classpath. (so even if you place tools.jar in
your WEB-INF/lib it doesn't work).
 - ricardo used getSystemResource() in the XSP engine as well (probably
due to classloading problems in JVM 1.1)
> I have an example in mind :
> Suppose the Servlet Container ClassLoader has the SAX interfaces in its
> classpath list (in particular the SAX helpers classe 'ParserFactory' ).
> Then suppose you have the Sun's parser classes in the WebApplication
> ClassLoader (xml.jar in web-inf/lib directory), and that in the servlet
> you want to instanciate a Parser through the method
> ParserFactory.makeaArser("com.sun.xml.parser.Parser"), then you're fu#
> up, because even though the ParserFactory is available into the
> WebApplication ClassLooder, it uses the class from the ServletContainer
> classLoader which cannot see the Sun pacakge, therefore cannot
> instanciate this class... You'll end up with a ClassNotFound Exceptipion
> eventhough you put all the required librairies in web-inf/lib

JAXP doesn't allow you to "ask" for a specific parser, this solves your

but yes, you are right, classloaders are hard to deal with because are
rarely different from system classloader.

Anyway, if you place "all" the necessary classes in the WEB-INF/lib it
works (of course, you have to place the compiler as well) without
affecting the rest of the system.

So, while the Dummy servlet could ask for ParserFactory.getParser() and
receive "com.sun.xml.parser.Parser" since Catalina ships with this,
Cocoon calls the same method but receives Xerces because we ship a
different JAXP implementation as well.
> This is a very very simple but common case. And I believe that these
> issues will become more and more problematic.

No, JDK 1.1 had many problems with classloaders but they were resolved
in JDK 1.2. Now, Pier and I are working to solve the issues with Javac
or create a workaround for it... but we should have to wait for JDK 1.4
to have it fixed :(

> Just think about Avalon package if Catalina decides to use it !!!!

I know, I know... :/

Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<>                             Friedrich Nietzsche
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------

View raw message