Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 12142 invoked by uid 500); 23 Mar 2001 23:50:09 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: tomcat-dev@jakarta.apache.org Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 12132 invoked from network); 23 Mar 2001 23:50:08 -0000 Message-ID: <3ABBE1CA.F7D8C506@eng.sun.com> Date: Fri, 23 Mar 2001 15:52:42 -0800 From: "Craig R. McClanahan" X-Mailer: Mozilla 4.76 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Kevin Jones CC: Tomcat-Dev Subject: Re: Still have XML loading problems References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Kevin Jones wrote: > > It (the JSP servlet) is loaded early already. > > > > It (and its XML parser) are now loaded by another classloader (not sure > > that was > > true on the 22nd -- if your Tomcat 4.0 has "jasper-compiler.jar" and > > "jasper-runtime.jar" separated, then it is for you). > > I have jasper-compiler.jar in 'jasper' and jasper-runtime.jar in 'lib' > If I had looked at my calendar I would have figured that one out ... > > > > The problem is the following scenario: > > > > * JSP servlet loads early, parses TLDs from the web.xml file (which > > causes some JAXP parser classes to be loaded). > > > > * You do something with Xerces that causes Xerces classes to > > be loaded, from your webapps class loader (parent of the one > > used by the JSP servlet). > > > > * You do something with a JSP page that causes more parser > > classes to be loaded (from the JSP servlet's classloader), including > > a class with the same fully qualified name as one of the Xerces > > classes you just loaded. > > > > * Under 1.2 this worked. Under 1.3 it gives sealing violation errors > > > > I'm not seeing this sequence (I don't think) > > * I'm loading Xerces in my listener (in fact all I'm doing is using the > DocumentBuilder and DocumentBuilderFactory), in the contextInitialized > method, this is getting loaded first. > Yep, Listeners (and Filters) get initialized before any servlets do. > > * JSP servlet is trying to load - in it's init() method I get the exception > > No TLDs but I see a call to TldLocationsCache. > The constructor calls processWebDotXml(), which scans web.xml looking for directives (using an XML parse, of course). You're seeing the same symptom from operations in a different order, but the cause is identical -- when a JAXP class is loaded *after* a Xerces class (even though the Xerces class is loaded from a parent class loader), you get the error on a 1.3 JVM. > Kevin Jones > Craig