tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jess Holle <>
Subject Re: common/endorsed & classLoader
Date Fri, 20 Aug 2004 14:19:58 GMT
Jeanfrancois Arcand wrote:

> Jess Holle wrote:
>> Costin Manolache wrote:
>>> To make things a bit more interesting, I believe there are some 
>>> checks in JDK1.4 to prevent you to override rt.jar classes. That's 
>>> what "endorsed" really does, allow you to bypass those checks.
>>> I don't think we managed to get xerces and jaxp to load from a 
>>> classloader even with delegation disabled.
>> Xerces would certainly load.
>> Do you really need Xerces' JAXP rather than that in 1.4?
> Yes, because in 1.4, Crimson is used and doesn't support XML schema. 
> That's the only good reason we have to use Xerces when validating a 
> web.xml. Note thatn in 1.5, Xerces packages have been renamed to 
>*, which will resolve a lot of problem (ex: 
> you should be able to bundle any xerces version in your war). I didn't 
> test it yet....

Xerces does not have to be endorsed or even be *the* endorsed JAXP XML 
implementation to be used for purposes like validating XML schema.  One 
can simply directly use the given JAXP factory class -- or better yet 
use a loader that first tries for the 1.5 repackaged JAXP factory and 
then reverts to the standard Xerces class naming or some such.  If this 
is not feasible (e.g. if the digester, etc, code involved simply grabs 
the currently defined JAXP implementation), one could always just have a 
given classloader force Xerces to be the JAXP implementation for 
everything within it (by redirecting request for the given 
meta-inf/services entries to define Xerces as the XML implementation).  
Such a classloader could also have the smarts not to do this in Java 1.5....

Now if the 1.5 JAXP interfaces themselves render the current Xerces 
inoperable that is a bigger issue -- and one which I would have to chalk 
up as a serious design flaw in JAXP, i.e. one should not grow interfaces 
in such a way as to break all existing implementations -- rather one 
should add a sub-interface and provide APIs to request the 
sub-interface, etc.  I sincerely hope Sun has not mis-stepped in such a 
major way with something as central as JAXP...

Jess Holle

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

View raw message