I did something similar for iplanet. I copied xalan.jar to the AppServer's jre/lib/ext and the extension classes in WEB-INF location. I did get this error [07/Sep/2001 11:07:23:3] error: Exception: SERVLET-run_failed: Failed in running template: /NASApp/cs/ContentServer, java.lang.NoClassDefFoundError: javax/xml/p arsers/FactoryConfigurationError Exception Stack Trace: java.lang.NoClassDefFoundError: javax/xml/parsers/FactoryConfigurationError I had to copy xerces.jar also to the jre/lib/ext and then it works ok. Am I on the right path here? -Uma -----Original Message----- From: Gary L Peskin [mailto:[EMAIL PROTECTED]] Sent: Monday, August 13, 2001 4:33 PM To: [EMAIL PROTECTED] Subject: Re: extension functions and Tomcat Hi, Dmitry -- Can you please try this to help us out? 1. Be sure you have the following: <RequestInterceptor className="org.apache.tomcat.request.Jdk12Interceptor" /> as the LAST RequestInterceptor in your conf/server.xml file. 2. Place xalan.jar ONLY in ${tomcat_lib}/lib 3. Place your extension ONLY in ${web_app}/web-info/lib 4. Stop/Start Tomcat 5. Tell us if this is able to find your extension now. Thanks, Gary Dmitry Beransky wrote: > > Gulli, > > I will disagree on a couple of accounts, if I may, > > First, how a class loader finds classes is completely up to the particular > classloader. For example, it is my understanding that in Tomcat 3.2 and > prior, the classloader would do a postfix traversal of the loader > hierarchy, that is, it would first delegate loading to the parent loader > and if the parent couldn't locate the class, then it would apply its own > heuristics, whatever they are. In Tomcat 3.3 & 4.0, this behavior has been > changed to prefix traversal. > > It "should" be possible to place xalan.jar in ${tomcat_home}/lib and have > it shared by all the applications, but apparently, currently it doesn't > work. Hence, my problem. That's because when xalan is in tomcat's lib > directory, it's been loaded by Tomcat's classloader (not the application > loader) and it actually always stays withing the context of that > classloader (that's why I believe that getContextClassLoader() call doesn't > really do anything useful). > > Regards > Dmitry > > At 12:26 PM 8/13/2001, Gunnlaugur Thor Briem wrote: > >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 > >
