"Len, Peter" wrote:
> Bob,
>
> I don't really understand it but what I heard was that any xml jar that
> you want to add to your context will need to go in the $TOMCAT_HOME/lib
> dir rather that your context's WEB-INF/lib dir. XML apparently is
> considered differently that your other .jar files. Again, I don't know
> exactly why but that seesm to be the case. I have my xerces.jar in the
> $TOMCAT_HOME/lib and the rest of my jars in the WEB-INF/lib and
> everything is fine.
>
Actually, there is nothing special about XML jars versus others. But what goes
in depends very much on which Tomcat version you are talking about.
Tomcat 3.2 follows the normal Java2 delegation model (simulated when running on
a JDK 1.1 system), so that if you ask for class a.b.c.foo, the loader looks in
the shared class path *first*, and the WEB-INF area *second*. The net effect of
this is that you cannot override classes found in the shared area with the same
name -- even if you put your own JAR file in WEB-INF/lib.
Tomcat 4 follows the new rules in the servlet 2.3 PFD spec, which allows a
container to change this so that loading starts with your WEB-INF areas first.
Consider the following scenario - I put a copy of the Postgres JDBC driver (just
to show that it's not specific to xml parsers :-) in my shared library
directory, because lots of my apps need it. But, one of my webapps needs a
different version of the Postgres driver, because it depends on a new feature
that was implemented in a later version. So, I put the new driver file in the
WEB-INF/lib directory of my webapp, and install it in Tomcat.
Under Tomcat 3.2, the newer driver is ignored (because it's got the same class
names). Under Tomcat 4.0, the newer driver is respected for that webap -- all
others continue to use the shared one.
>
> FYI: Tomcat 3.2 comes with a jaxp.jar file for its own use. If you
> just drop your xerces.jar file in that lib directory you may encounter
> problems (as I had) because the jaxp.jar will come before the xerces.jar
> file in the CLASSPATH. I renamed my xerces.jar to a_xerces.jar so that
> I know it gets loaded first and that I won't run into a conflict with
> the same classes listed in both jar files.
>
If you want to use Xerces under Tomcat 3.2, you should put xerces.jar under
$TOMCAT_HOME/lib and remove jaxp.jar and parser.jar.
>
> Peter Len
>
Craig McClanahan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]