geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toby cabot <>
Subject problem with xerces and web apps
Date Mon, 24 Jan 2005 21:56:35 GMT
Hi Folks,

I've been using Geronimo for a while now and it works great.  I just
updated from Subversion today and now I have a problem at run-time
with Xerces inside a web app that appears to be classloader related.
I'm using Axis which uses Xerces so I added the xerces jars to my .war
file.  When Xerces starts I get:

        at org.apache.xerces.parsers.DOMParser.<init>(
        at org.apache.xerces.parsers.DOMParser.<init>(
        at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(
        at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(
        at org.apache.axis.utils.XMLUtils.newDocument(
        at org.apache.axis.utils.XMLUtils.newDocument(
        at org.apache.axis.configuration.FileProvider.configureEngine(
        at org.apache.axis.AxisEngine.init(
        at org.apache.axis.AxisEngine.<init>(
        at org.apache.axis.server.AxisServer.<init>(
        at org.apache.axis.server.DefaultAxisServerFactory.createServer(
        at org.apache.axis.server.DefaultAxisServerFactory.getServer(
        at org.apache.axis.server.AxisServer.getServer(
        at org.apache.axis.transport.http.AxisServletBase.getEngine(
        at org.apache.axis.transport.http.AxisServletBase.getOption(
        at org.apache.axis.transport.http.AxisServletBase.init(
        at javax.servlet.GenericServlet.init(

The Xerces code looks like (see [1]):


So it looks as if the problem is that the object that comes back from
ObjectFactory.createObject() can't be cast to an
XMLParserConfiguration.  The strange part is that it looks as if the
correct object is coming back, at least if I just print out the class
name.  The difference between a 2 week old Geronimo build and this one
is that this one appears to have two different instances of
org.apache.geronimo.jetty.JettyClassLoader in play, whereas the 2 week
old version only had one.  Xerces ObjectFactory has explicit code to
find the right classloader to use, their code is in findClassLoader()
at [2], in the two week old Geronimo build that code returned the same
classloader that this.getClass().getClassLoader() returns and the cast
succeeds, in the current build it finds a different classloader and
the cast throws a ClassCastException.

Any ideas how I can get around this are appreciated.


[2] Code that Xerces uses to find the classloader:

View raw message