cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Oliver <>
Subject Re: Bug 16580; compiling xsp with classpath
Date Mon, 17 Feb 2003 04:29:10 GMT
OK. I get it. The old version of Xalan that comes with the JDK 
incorrectly throws that exception when processing one of  Cocoon's 
stylesheets. By placing a new version of Xalan in Tomcat's endorsed 
directory ( the newer 
version of Xalan is loaded first.

This is a common classloading problem but it is exacerbated by poorly 
designed interfaces, in this case the culprits seem to be 
javax.xml.transform.TransformerFactory (which relies on a system 
property (why is this bad? Think global variable)) and 
org.apache.avalon.excalibur.xml.xslt.XSLTProcessor (which relies on 
thread context class loader (why is this bad? Again, think global 
variable)). The reason both resort to using external variables is that 
the interfaces they define are missing one or more necessary parameters. 
I don't know how much such issues have been discussed on this list, so I 
won't go into this in more detail here. If it weren't for these 
additional problems, it wouldn't be necessary to resort to Sun's 
"endorsed" directory hack, a Cocoon component could simply load the 
implementation it needed using a private class loader.



Joerg Heinicke wrote:

> Not exactly, but the JDK 1.4 comes with older versions of Xalan, 
> Xerces and so on and there seem to be some incompatibilities. And 
> normally JDK classes are loaded first => the well-known endorsed problem.
> Joerg
> Christopher Oliver wrote:
>> Yes, adding xsltc-XXXXX.jar to common/endorsed fixed that problem. 
>> But what exactly caused it in the first place? Can someone explain?
>> Regards,
>> Chris
>> Ugo Cei wrote:
>>> Christopher Oliver wrote:
>>>> Sylvain,
>>>> Can you explain the connection between Xalan.jar, the endorsed 
>>>> directory, and the error message below? Unfortunately, I already 
>>>> tried copying xalan-2.4.1.jar, xercesImpl-2.1.0.jar and 
>>>> xml-apis.jar into %TOMCAT_HOME%/lib/endorsed but still got the same 
>>>> error.
>>>                ^^^^ --> Make that common/endorsed
>>> Remove the existing jars from common/endorsed and put the above 
>>> mentioned jars (plus xsltc.jar, I'm not sure it's needed but I have 
>>> it there too) and it should work perfectly with JDK 1.4.1.
>>>     Ugo
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, email:

To unsubscribe, e-mail:
For additional commands, email:

View raw message