You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Hong Li <ho...@peak-corp.com> on 2003/02/24 12:07:26 UTC
Tomcat 4.1.18 standard version & XML parser
All,
this might be a old question but I'd searched online and can't find any
tomcat 4.1.x related. so hope someone could help.
I am using a vendor's jar file which need using a version of Xerces
parser(sorry asking them now which version) so I guess can't use default
tomcat one. so I place the xercesImpl.jar (from them) into the
MYAPPDIR/WEB-INF/lib. I am not start tomcat using the -D endors setting so
the parser in COMMON/ENDORSED shouldn't be used by tomcat. in this case, can
I tell that all my appl is using the parser in MYAPPDIR/WEB-INF/lib instead
of any others? Neither the one from JDK 1.4(I am using 1.4.02) nor tomcat
internal?
Many thanks,
HL -let me send this mail before I go insane.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
RE: Tomcat 4.1.18 standard version & XML parser
Posted by Hong Li <ho...@peak-corp.com>.
Oops, is this why fewer people response? Ok, from the documentation of 4.1.18,"Class Loader HOW-TO",at the bottom said as below:
.....................
XML Parsers and JDK 1.4
Among many other changes, the JDK 1.4 release packages the JAXP APIs, and a version of Xerces, inside the JDK. This has impacts on applications that wish to use their own XML parser.
In previous versions of Tomcat 4, you could simply replace the XML parser in the $CATALINA_HOME/common/lib directory to change the parser used by all web applications. However, this technique will not be effective when you are running on JDK 1.4, because the usual class loader delegation process will always choose the implementation inside the JDK in preference to this one.
JDK 1.4 supports a mechanism called the "Endorsed Standards Override Mechanism" to allow replacement of APIs created outside of the JCP (i.e. DOM and SAX from W3C). It can also be used to update the XML parser implementation. For more information, see: http://java.sun.com/j2se/1.4/docs/guide/standards/index.html.
Tomcat utilizes this mechanism by including the system property setting -Djava.endorsed.dirs=$CATALINA_HOME/common/endorsed in the command line that starts the container. Therefore, you can replace the parser that is installed in this directory, and it will get used even on a JDK 1.4 system.
.........................
So what I said "I am not start tomcat using the -D encors setting" etc, really based on above description. What I mean there is, since I am not use "-D java.endorsed.dirs=$CATALINA_HOME/common/endorsed ", so Tomcat 4.1.18 I am using must use the XML parser from the JDK1.4 I'd installed. but since I place my own parser under MYAPP/WEB-INF/lib as described of above document "Class Loader HOW-TO",
........
xerces.jar - The XML parser that is visible by default to Tomcat internal classes and to web applications. This can be overridden, for a particular web application, by including your desired parser in /WEB-INF/lib
........
So I am doing as the same, put own parser in /WEB-INF/lib, why Tomcat seems still not using it? I use this parser with my app with Tomcat 4.0.6, all fine.
Many thanks,
HL
-----Original Message-----
From: Jacob Kjome [mailto:hoju@visi.com]
Sent: 2003年2月24日 23:05
To: Tomcat Users List
Subject: Re: Tomcat 4.1.18 standard version & XML parser
Not sure what you mean by "I am not start tomcat using the -D endors setting so
the parser in COMMON/ENDORSED shouldn't be used by tomcat", because the
parser in common/endorsed will get used if it exists. This is by
default. You would have to modify the default for this not to be the case.
Secondly, if you use j2sdk1.4.x, you cannot put endorsed libraries such as
javax.xml.*, org.w3c.dom.*, and org.xml.sax.*, etc... into
WEB-INF/lib. That would violate the Sun classloading spec. Tomcat
enforces the Sun classloading spec. What you will need to do is remove
xerces from WEB-INF/lib and copy it to common/endorsed overwriting the
existing Xerces. Try that and see if it works.
Jake
At 07:07 PM 2/24/2003 +0800, you wrote:
>All,
>
>
>this might be a old question but I'd searched online and can't find any
>tomcat 4.1.x related. so hope someone could help.
>
>I am using a vendor's jar file which need using a version of Xerces
>parser(sorry asking them now which version) so I guess can't use default
>tomcat one. so I place the xercesImpl.jar (from them) into the
>MYAPPDIR/WEB-INF/lib. I am not start tomcat using the -D endors setting so
>the parser in COMMON/ENDORSED shouldn't be used by tomcat. in this case, can
>I tell that all my appl is using the parser in MYAPPDIR/WEB-INF/lib instead
>of any others? Neither the one from JDK 1.4(I am using 1.4.02) nor tomcat
>internal?
>
>
>
>Many thanks,
>
>
>HL -let me send this mail before I go insane.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Tomcat 4.1.18 standard version & XML parser
Posted by Jacob Kjome <ho...@visi.com>.
Not sure what you mean by "I am not start tomcat using the -D endors setting so
the parser in COMMON/ENDORSED shouldn't be used by tomcat", because the
parser in common/endorsed will get used if it exists. This is by
default. You would have to modify the default for this not to be the case.
Secondly, if you use j2sdk1.4.x, you cannot put endorsed libraries such as
javax.xml.*, org.w3c.dom.*, and org.xml.sax.*, etc... into
WEB-INF/lib. That would violate the Sun classloading spec. Tomcat
enforces the Sun classloading spec. What you will need to do is remove
xerces from WEB-INF/lib and copy it to common/endorsed overwriting the
existing Xerces. Try that and see if it works.
Jake
At 07:07 PM 2/24/2003 +0800, you wrote:
>All,
>
>
>this might be a old question but I'd searched online and can't find any
>tomcat 4.1.x related. so hope someone could help.
>
>I am using a vendor's jar file which need using a version of Xerces
>parser(sorry asking them now which version) so I guess can't use default
>tomcat one. so I place the xercesImpl.jar (from them) into the
>MYAPPDIR/WEB-INF/lib. I am not start tomcat using the -D endors setting so
>the parser in COMMON/ENDORSED shouldn't be used by tomcat. in this case, can
>I tell that all my appl is using the parser in MYAPPDIR/WEB-INF/lib instead
>of any others? Neither the one from JDK 1.4(I am using 1.4.02) nor tomcat
>internal?
>
>
>
>Many thanks,
>
>
>HL -let me send this mail before I go insane.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org