Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 37751 invoked from network); 13 Sep 2002 00:06:27 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 13 Sep 2002 00:06:27 -0000 Received: (qmail 21601 invoked by uid 97); 13 Sep 2002 00:06:48 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 21564 invoked by uid 97); 13 Sep 2002 00:06:47 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 21552 invoked by uid 98); 13 Sep 2002 00:06:47 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-Id: <5.1.0.14.2.20020912190158.035b9a18@shell.visi.com> X-Sender: hoju@shell.visi.com X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Thu, 12 Sep 2002 19:12:07 -0500 To: "Tomcat Users List" From: Jacob Kjome Subject: Re: Running XML-parsing servlets on Tomcat, using JAXP ? In-Reply-To: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=====================_519755208==_.ALT" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --=====================_519755208==_.ALT Content-Type: text/plain; charset="us-ascii"; format=flowed common/endorsed only exists in Tomcat-4.1.x, not 4.0.x. Also, since you are using JDK1.3.x, there is no concept of the Endorsed Standards Override Mechanism as that was introduced with the release of j2sdk1.4.0. I imagine that the common/endorsed directory doesn't really act any different than common/lib when running under JDK1.3.x, but when running with j2sdk1.4.x, common/endorsed provides a way to override classes in the JDK itself. So, if the JDK used an older version of Xerces, you could put a newer version in common/endorsed and it would be used instead of the one that came with the JDK. That same newer library in common/lib would be ignored as the JDK would take precedence in classloading. Putting your classes in $CATALINA_HOME/lib (same as $CATALINA_HOME/shared/lib in Tomcat-4.1.x) or common/lib is the way to go in your setup. With j2sdk1.4.x, you might think about putting them in common/endorsed which is where the Xerces libraries are in the full version of Tomcat-4.1.x (not the jdk1.4-lite version as it is assumed that the JDK provides those libraries). You can permanently add these to your system under j2sdk1.4.x by putting them in $JAVA_HOME/jre/lib/endorsed. You will have to create the "endorsed" directory if it isn't there already. This does the same thing as common/endorsed in Tomcat, only it affects the entire system. server/lib is not viable to put your libraries unless they are only for the container's use. Your app cannot see libraries in that folder. As far as affecting Tomat, endorsed stuff will affect it, but stuff you just put on the classpath won't affect Tomcat at all since it ignores the system classpath. Jake At 07:08 AM 9/13/2002 +0800, you wrote: >Thank you very much for replying, Jean-Francois, > >>From: Jean-Francois Arcand >> >>You don't need the jax-pack for your problem. Under >>{CATALINA_HOME}/common/endorsed, just copy the xerces.jar and the >>jaxp-ri.jar file. Tomcat will uses this folder for selecting which parser >>to use (so crimson will not be used). > >I don't have a "common/endorsed" folder. Is this specific to more >recent versions of Tomcat ? I'll create it anyway. > >Also, I've got a jaxp.jar and jaxp-api.jar file but what is >jaxp-ri.jar ? > >I'd still like to keep jaxp installed on my machine for other >java applications. This won't affect Tomcat at all, will it ? > >Thank you again. > >Soefara. > > > >>Soefara Redzuan wrote: >> >>>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 >>>http://java.sun.com/xml/javaxmlpack.html >>> >>>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. > > >_________________________________________________________________ >Send and receive Hotmail on your mobile device: http://mobile.msn.com > > >-- >To unsubscribe, e-mail: >For additional commands, e-mail: --=====================_519755208==_.ALT--