This is a JVM thing, not a tomcat thing.  You're not normally allowed to
override built-in Java classes locally (for security reasons).  In JDK
1.4, the XML/XSLT classes are built in.  The endorsed standards override
mechanism was added to 1.4 because of the fact that some people might
need or want to use an alternate XML parser or transformer.  So the
JAVA_ENDORSED_DIRS thing tells the JVM that it's OK to override Xalan
with libraries from the specified directories.

So I don't think there's any way to specify on a per-webapp basis which
impl to use.  It's all or nothing at the VM instance level.

Also see http://java.sun.com/j2se/1.4/docs/guide/standards/ for more
info.
-- 
Tim Moore / Blackboard Inc. / Software Engineer
1899 L Street, NW / 5th Floor / Washington, DC 20036
Phone 202-463-4860 ext. 258 / Fax 202-463-4863


> -----Original Message-----
> From: Voytenko, Dimitry [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, February 21, 2003 12:30 AM
> To: '[EMAIL PROTECTED]'
> Subject: class-loading and java.endorsed.dirs
> 
> 
> Hi,
> 
> Here's what happend. It looks pretty strange. I couldn't find 
> explanation to this neither in Tomcat docs, Servlet specs or 
> Mailing List.
> 
> I have a servlet, with doGet implemented as:
> 
>       System.err.println("XALAN VERSION = " + 
> org.apache.xalan.Version.getVersion());
> 
> In the application's WEB_INF/lib directory I have xalan.jar 
> of version 2.4.1, which I thought should have been used. But 
> instead, as the result of execution of the servlet, I got
> 
>       XALAN VERSION = Xalan Java 2.2 D11
> 
> This is the Xalan version included to JDK 1.4.
> 
> Isn't application's JAR should be used (as stated in 
> SRV.9.7.2 of the Servlet 2.3 specification)?
> 
> Then, I changed "setclasspath.bat" JAVA_ENDORSED_DIRS env. 
> variable to include my WEB_INF/lib directory (application 
> wasn't packed into WAR). This variable is then passed as the 
> value of "java.endorsed.dirs" java startup parameter. As the 
> result, I got
> 
>       XALAN VERSION = Xalan Java 2.4.1
> 
> which I expected in the first place.
> 
> Does this mean that libraries in the endorsed dir have bigger 
> priority? It's a little confusing why this change whould make 
> such a difference. Is there a way to specify forcefully that 
> application should only use local libraries if they're specified?
> 
> Thanks,
> Dimitry E Voytenko

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to