tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Soefara Redzuan" <>
Subject Running XML-parsing servlets on Tomcat, using JAXP ?
Date Thu, 12 Sep 2002 17:20:38 GMT
Has anybody managed to run XML-parsing servlets on Tomcat 4 using JAXP?
If so, could you please help me with the XML configuration for
Tomcat because I keep getting class clashes. Here's what I've done
so far,

1. Downloaded the Java XML Pack from

2. Unpacked the Java XML Pack and put the JAXP jar files (dom.jar,
   jaxp-api.jar, sax.jar, xalan.jar, xercesImpl.jar and xsltc.jar)
   in the directory c:\jdk1.3\jaxp-1.2_01

3. Added all the jars to the CLASSPATH

4. The Java XML Pack instructions then read,

   > When you run the examples on Tomcat you must copy all
   > the JAR files from the Java XML Pack to CATALINA_HOME/common/lib .
   > Some of these files already exist in Tomcat distribution and
   > should be overwritten by the Java XML Pack JARs. The xerces.jar
   > that comes with the tomcat installation should also be removed
   > from CATALINA_HOME/common/lib.

   I copied all of the JAXP jar files (dom.jar, jaxp-api.jar,
   sax.jar, xalan.jar, xercesImpl.jar and xsltc.jar) to
   CATALINA_HOME/common/lib but strangely none of them existed
   there previously ! Also, there was no "xerces.jar" that
   supposedly came with the Tomcat distribution according to the
   Sun documentation.
   There is however, a crimson.jar (I'm using an early Tomcat4.x)
   and a jaxp.jar which I removed, since JAXP's jaxp-api.jar
   seems to contain updated libraries.

5. I restarted Tomcat and then tried to run a servlet which
   uses some XML-parsing, which I have already tested in a
   standalone command-line program and found to be working OK.

   However, the servlet generated this error,
   "java.lang.LinkageError: loader constraints violated when linking
    org/xml/sax/InputSource class"

   which I believe means that the Tomcat class loader is finding
   two conflicting org.xml.sax.InputSource classes (and possibly
   associated libraries).

This was my big worry with adding XML libraries to my operating
system, that they would clash with Tomcat's to stop functioning.
How should I have arranged things to make this work ?

I put all the JAXP libraries in c:\jdk1.3\jaxp-1.2_01 and added
them to the CLASSPATH so that I can easily compile all XML programs
without defining where to find the Sax libraries and classes,
because my XML applications are not just for Tomcat.

Thank you so much for any help.


Join the world’s largest e-mail service with MSN Hotmail.

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

View raw message