tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Francois Arcand <>
Subject Re: WEB-INF/lib Xerces2 vs. common/lib Xerces 1
Date Fri, 13 Sep 2002 20:53:28 GMT
If you don't want to update Tomcat, you have two solutions:

(1) If you are using JDK 1.4, add the following in the catalina.bat 
where java is invoked

-Djava.dir.endorsed="location of your Xerces files"

The VM will use by default your Xerces 2 jar file


(2) If you are using JDK 1.2 or 1.3

copy your file under {java_home}\jre\lib\ext

That will have the same effect has (1). You may want to move to another 
location the Xerces1 files, just in case (I cannot test this solution)

-- Jeanfrancois

Jacob Kjome wrote:

>Hello Michael,
>If you use j2sdk1.4.x, the JDK will override the older xerces with its
>own version.
>Otherwise, upgrade to Tomcat-4.1.10 because it uses the latest Xerces
>by default (in common/endorsed).
>Friday, September 13, 2002, 3:16:05 PM, you wrote:
>MR> Hey All,
>MR> I've got a weird class loading problem that I was wondering if somebody 
>MR> knew the best workaround:
>MR> We're shooting to deliver Xerces 2 with our webapp framework (Expresso)... 
>MR> but since Tomcat comes with Xerces 1 in the common/lib, I'm finding a weird 
>MR> conflict.  The directory layout is:
>MR>         -common/lib/xerces.jar
>MR>         -webapps/ROOT/WEB-INF/lib/xercesImpl.jar
>MR>         -webapps/ROOT/WEB-INF/lib/xmlapis.jar
>MR>         -webapps/ROOT/WEB-INf/lib/xalan.jar
>MR> The offending code is as follows:
>MR> DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
>MR> dbf.setNamespaceAware(true);
>MR> dbf.setValidating(false);
>MR> DocumentBuilder db = dbf.newDocumentBuilder();
>MR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>MR> When the last line is called, I get a 'class not found' error, which is 
>MR> DOMErrorHandler (Xerces 2 specific).  So obviously, the above code is 
>MR> picking up a combination of Xerces 1 jar, and Xerces 2 jar.
>MR> So, since we don't want to have every installation out there deleting the 
>MR> xerces.jar that comes with Tomcat 4, does anybody have a suggested 
>MR> workaround so that we can make sure we're getting the Xerces 2 
>MR> DocumentBuilder??
>MR> Thanks in advance!!
>MR>                                                 -Mike
>MR> --
>MR> To unsubscribe, e-mail:   <>
>MR> For additional commands, e-mail: <>

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

View raw message