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 <load-on-startup>
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.<init>
>

The constructor calls processWebDotXml(), which scans web.xml looking for
<taglib> 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


Reply via email to