Hi,

just to clear it up for everyone, the fix makes perfect sense,
but no, it isn't necessary to copy xalan.jar into every webapp.

It makes sense because you made sure that xalan.jar was found by
the same classloader as your extension classes. That is the real
requirement. You satisfied this requirement by placing xalan.jar
in the webapp classloader, where the extension classes were. If
the same xalan.jar needs to be available to ALL webapps in the
servlet engine (which it probably usually does) then you should
instead satisfy this requirement by placing the extension classes
in the ${tomcat_home}/lib, where xalan.jar was originally. Either
way will work -- they just need to be together.

Actually, to be pedantically precise, having xalan.jar in the
webapp lib and the extension classes in ${tomcat_home}/lib would
also work (though it would be a pretty silly configuration)...
the extension classes need to be accessible to Xalan's classloader,
and they are, if they are defined in that classloader or one of its
ancestor classloaders. The ${tomcat_home}/lib classloader is the
parent or ancestor classloader of any webapp classloader, hence
any class defined in it is available in any webapp.

This is all crystal-clear if you know how a ClassLoader finds its
classes. When asked to find a class, any ClassLoader will first
ask its parent classloader and then try to to find the class
itself, but will not ask any of its child classloaders (I believe
it doesn't even know about them). For the complete story, see
http://java.sun.com/j2se/1.3/docs/api/java/lang/ClassLoader.html

Hope that leaves no trace of confusion! :)

        - Gulli



-----Original Message-----
From: Gary L Peskin [mailto:[EMAIL PROTECTED]]
Sent: 13. agust 2001 18:14
To: [EMAIL PROTECTED]
Subject: Re: extension functions and Tomcat


Well, that will work but it shouldn't be necessary to copy xalan.jar
into the web-info/lib directory of every webapp.  I'll look into this
further but I'm glad that this is working for you now.

Gary

Dmitry Beransky wrote:
> Gary,
>
> I'm including the environment info at the end of the message.  However,
> with Gulli's help I was able to fix the problem.  It turned out, all I had
> to do was to move xalan.jar out of ${tomcat_home}/lib and into
> ${web_app}/web-info/lib.  I hope, this is an appropriate fix.
>
> Thanks
> Dmitry
>
> #---- BEGIN writeEnvironmentReport($Revision: 1.5 $): Useful properties
> found: ----
> java.version=1.3.0
> #---- BEGIN Listing XML-related jars in: foundclasses.java.class.path ----
> xerces.jar.apparent.version=xerces.jar potential-ERROR
present-unknown-version
> xerces.jar.path=C:\jakarta-tomcat-3.2.2\bin\..\lib\xerces.jar
> #----- END Listing XML-related jars in: foundclasses.java.class.path -----
> version.JAXP=1.1
> java.ext.dirs=c:\javasoft\jre\1.3\lib\ext
> version.crimson=not-present
>
java.class.path=..\classes;..\lib\ant.jar;..\lib\jasper.jar;..\lib\servlet.j
ar;..\lib\webserver.jar;..\lib\xerces.jar
> version.xerces=Xerces 1.4.2
>
sun.boot.class.path=c:\javasoft\jre\1.3\lib\rt.jar;c:\javasoft\jre\1.3\lib\i
18n.jar;c:\javasoft\jre\1.3\lib\sunrsasign.jar;c:\javasoft\jre\1.3\classes
> version.DOM.draftlevel=2.0fd
> version.xalan2=Xalan;Java;Xalan Java 2.2.D8;
> version.DOM=2.0
> version.xalan1=not-present
> #----- END writeEnvironmentReport: Useful properties found: -----
> # YAHOO! Your environment seems to be OK.
>
> At 10:08 PM 8/11/2001, you wrote:
> >Dmitry --
> >
> >All current versions of XalanJ2 should be using the correct Tomcat class
> >loader.  Please provide details as to the directory where xalan.jar is
> >located and and the directory where the extension is located.  What
> >version of XalanJ are you using?  What version of the JDK are you
> >using?  What error message are you receiving (with stack trace if
> >possible).
> >
> >
> >Thanks,
> >Gary

Reply via email to