tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antti Rauramo <>
Subject Tomcat 5.5.9, endorsed jars and classloader
Date Wed, 31 Aug 2005 07:13:52 GMT
Hello all,

I ran into problems with Tomcat 5.5.9. We have xercesImpl.jar in 
common/endorsed, and another jar (X-Hive's XML database's xhive.jar) in 
common/lib, that includes a class that is put in the xerces package 
(org.apache.xerces.dom) in order to access xerceses package protected 
class ObjectFactory. This works as long as the classloader is the same 
for both xerces and xhive.

With older tomcats this has been works fine for years now, but with 
5.5.9 an IllegalAccessException is thrown.

I wrote a test case that seems to prove the case, or at least some 
difference. Basically there are two classes, testing.A and testing.B. A 
creates an instance of B and accesses a method that returns the 
instances classloader.

When A is in common/lib/a.jar and B in common/lib/b.jar, both Tomcats 
displays the same classloaders for A and B.

When A is in common/lib/a.jar and B in common/endorsed/b.jar, Tomcat 
4.1.31 displays the same classloaders for both A and B, but Tomcat 5.5.9 
displays a classloader for A but null for B.

The server with Tomcat 4.1.31 runs Sun's JDK 1.5.0-b64, the one with 
Tomcat 5.5.9 runs Sun's JDK 1.5.0_04-b05. It is possible for me to 
upgrade the other if you think this may be an issue. The classloaders 
toString() output is actually different, come to think of it...

The test files are at so you 
can easily see for yourselves.

Antti Rauramo
Index Information Technologies Oy

View raw message