You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Drew Cox <dr...@epredix.com> on 2002/02/27 01:07:33 UTC

That old tomcat 4.0.2 - xerces.jar file problem one more time...please

I'm sorry guys.  I've searched the archives, really.  I have seen a bunch of
seemingly relevant posts and tried some of their recommendations.  But I
can't get this to work.  Here's the deal.

Our webapp includes xerces.jar in the web.inf/lib directory.  This works
fine on Tomcat 3.1 (our prod version) and 3.3a (our new prod version if I
can't get this sorted).

On 4.0.2 I get the following error in the tomcat logs, apparently when
trying to compile a JSP:

----- Root Cause -----
java.lang.NoClassDefFoundError: org/w3c/dom/range/Range
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:120)
	at
org.apache.xerces.parsers.DOMParser.setDocumentClassName(DOMParser.java:489)
	at org.apache.xerces.parsers.DOMParser.<init>(DOMParser.java:221)
	at
org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(DocumentBuilderImpl.java:9
8)
	at
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Documen
tBuilderFactoryImpl.java:87)
	at
org.apache.jasper.parser.ParserUtils.parseXMLDocument(ParserUtils.java:197)
	at
org.apache.jasper.compiler.TldLocationsCache.processWebDotXml(TldLocationsCa
che.java:165)
	at
org.apache.jasper.compiler.TldLocationsCache.<init>(TldLocationsCache.java:1
38)
	at
org.apache.jasper.EmbededServletOptions.<init>(EmbededServletOptions.java:34
5)
	at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:266)
	at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91
6)
	at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:653)

>From reading the previous posts and tomcat docs, it appears there are some
classloader/version conflicts with the xerces.jar in the
CATALINA_HOME/common/lib directory.  I have tried moving the catalina
xerces.jar around into all of the other libs in tomcat to no avail.

If I remove our webapp's xerces.jar, things work fine.  This is a reasonable
workaround, but what if I really needed different versions of the library
available to different apps?  I'm sure there is a simple way to make this
work, please help the terminally bewildered to get this working.

Thanks
Drew


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: That old tomcat 4.0.2 - xerces.jar file problem one more time...please

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Wed, 27 Feb 2002, Markus Spath wrote:

> Date: Wed, 27 Feb 2002 11:41:25 +0100
> From: Markus Spath <ms...@arcor.de>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: Re: That old tomcat 4.0.2 - xerces.jar file problem one more
>     time...please
>
> additional question:
>
> relies tomcat itself on the libs in CATALINA_HOME/common/lib ?
>
> if not, it could be a good idea to just remove all xml-related libraries from
> there and (redundantly) including them in WEB-INF/lib of the projects to gain
> some sort of control.
> - just a thought and i didn't have a closer look at the class-loading mechanism.
>

Tomcat relies on a JAXP/1.1 or later XML parser in four places:
* Parsing server.xml
* Parsing web.xml
* Parsing tag library descriptor files (TLD)
* Parsing JSP pages that are in the XML syntax

So, there must be an XML parser visible to the internal classes.  This can
be put in either common/lib (if web applications also need it), or in
server/lib.  The release notes document (in the top level directory of the
distribution) talks more about your options for using different XML
parsers.

> are there any best practices for that one might follow?
>
>
> Markus
>

Craig


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: That old tomcat 4.0.2 - xerces.jar file problem one more time...please

Posted by Markus Spath <ms...@arcor.de>.
additional question:

relies tomcat itself on the libs in CATALINA_HOME/common/lib ?

if not, it could be a good idea to just remove all xml-related libraries from 
there and (redundantly) including them in WEB-INF/lib of the projects to gain 
some sort of control.
- just a thought and i didn't have a closer look at the class-loading mechanism.

are there any best practices for that one might follow?


Markus


Drew Cox wrote:


> Our webapp includes xerces.jar in the web.inf/lib directory.  This works
> fine on Tomcat 3.1 (our prod version) and 3.3a (our new prod version if I
> can't get this sorted).
> 
> On 4.0.2 I get the following error in the tomcat logs, apparently when
> trying to compile a JSP:
> 
> ----- Root Cause -----
> java.lang.NoClassDefFoundError: org/w3c/dom/range/Range
> 	at java.lang.Class.forName0(Native Method)
> 	at java.lang.Class.forName(Class.java:120)
> 	at
> org.apache.xerces.parsers.DOMParser.setDocumentClassName(DOMParser.java:489)
> 	at org.apache.xerces.parsers.DOMParser.<init>(DOMParser.java:221)
> 	at
> org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(DocumentBuilderImpl.java:9
> 8)
> 	at
> org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Documen
> tBuilderFactoryImpl.java:87)
> 	at
> org.apache.jasper.parser.ParserUtils.parseXMLDocument(ParserUtils.java:197)
> 	at
> org.apache.jasper.compiler.TldLocationsCache.processWebDotXml(TldLocationsCa
> che.java:165)
> 	at
> org.apache.jasper.compiler.TldLocationsCache.<init>(TldLocationsCache.java:1
> 38)
> 	at
> org.apache.jasper.EmbededServletOptions.<init>(EmbededServletOptions.java:34
> 5)
> 	at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:266)
> 	at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91
> 6)
> 	at
> org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:653)
> 
>>>From reading the previous posts and tomcat docs, it appears there are some
> classloader/version conflicts with the xerces.jar in the
> CATALINA_HOME/common/lib directory.  I have tried moving the catalina
> xerces.jar around into all of the other libs in tomcat to no avail.
> 
> If I remove our webapp's xerces.jar, things work fine.  This is a reasonable
> workaround, but what if I really needed different versions of the library
> available to different apps?  I'm sure there is a simple way to make this
> work, please help the terminally bewildered to get this working.



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>