[jdom-interest] JDOM Xerces and Xalan versions

Joel P. Worrall jworrall at commnav.com
Wed Oct 24 14:40:16 PDT 2001


Martin:

I copied and compiled your code.  Changed my call to instantiate a new
XercesBuilder().  Now, the next section of errors crops up on the same
classes.  I'm not the brightest bulb on the tree, but this smells like a
ClasLoader issue.  Any help?

Stack trace below.

javax.servlet.ServletException: Servlet.init() for servlet FrontController
threw exception
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:871)
	at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3267)
	at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3384)
.... more
----- Root Cause -----
java.lang.IncompatibleClassChangeError
	at org.jdom.input.SAXBuilder.configureParser(SAXBuilder.java:450)
	at org.jdom.input.SAXBuilder.build(SAXBuilder.java:284)
	at org.jdom.input.SAXBuilder.build(SAXBuilder.java:583)
	at
com.commnav.sbh.framework.config.ServletConfigConfiguration.<init>(ServletCo
nfigConfiguration.java:42)


-----Original Message-----
From: Martin Bravenboer [mailto:mbravenb at students.cs.uu.nl]
Sent: Wednesday, October 24, 2001 4:50 PM
To: jworrall at commnav.com
Cc: jdom-interest at jdom.org
Subject: Re: [jdom-interest] JDOM Xerces and Xalan versions


Hey,


> I am experiencing ClassCastException when attempting to use the JDOM
> SAXBuilder with Tomcat 4.0.1 on the JDK 1.4.  It's trying to cast a
> SAXParser to an XMLReader (which I have built the source for and know it
> implements... very strange)


I had exactly the same problem, with JDK 1.4 beta 2 and Tomcat. I used a
very dirty hack to solve it. I didn't understand the problem (have tried
quite a lot of options) and had to use Xerces for XML Schema support.

import org.jdom.input.SAXBuilder;
import org.apache.xerces.parsers.SAXParser;
import org.xml.sax.XMLReader;

public class XercesBuilder extends SAXBuilder
{
	public XercesBuilder(boolean validating)
	{
		super(validating);
	}

	protected XMLReader createParser() throws Exception
	{
		return new SAXParser();
	}
}

Hope anyone can find out what's going, it's really very obscure.

Greetings,
Martin




More information about the jdom-interest mailing list