[jdom-interest] ClassCastException

Ramy Mamdouh ramy at imkenberg.net
Wed Jun 26 11:01:08 PDT 2002


Hello,

I'm using JDK 1.3 on SuSE Linux 8.0.

I get a ClassCastException when I try this piece of code .

SAXBuilder saxBuilder = new SAXBuilder(false);
saxBuilder.build(file);

I've all the required jars in my classpath, and in the right order as 
said in the faq.

here's the stack trace :

org.jdom.JDOMException: Error in building: 
org.apache.xerces.parsers.SAXParser
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:306)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:617)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:599)
    at 
com.imkenberg.webshop.cocoon.menu.xmlmenu.XMLMenuParserImp.parse(XMLMenuParserImp.java:75)
    at 
com.imkenberg.webshop.cocoon.menu.xmlmenu.test.XMLTest.testParsingFile(XMLTest.java:29)
    at java.lang.reflect.Method.invoke(Native Method)
    at junit.framework.TestCase.runTest(TestCase.java:166)
    at junit.framework.TestCase.runBare(TestCase.java:140)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:131)
    at junit.framework.TestSuite.runTest(TestSuite.java:173)
    at junit.framework.TestSuite.run(TestSuite.java:168)
    at junit.swingui.TestRunner$17.run(TestRunner.java:644)
Root cause: java.lang.ClassCastException: 
org.apache.xerces.parsers.SAXParser
    at org.jdom.input.SAXBuilder.createParser(SAXBuilder.java:392)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:283)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:617)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:599)
    at 
com.imkenberg.webshop.cocoon.menu.xmlmenu.XMLMenuParserImp.parse(XMLMenuParserImp.java:75)
    at 
com.imkenberg.webshop.cocoon.menu.xmlmenu.test.XMLTest.testParsingFile(XMLTest.java:29)
    at java.lang.reflect.Method.invoke(Native Method)
    at junit.framework.TestCase.runTest(TestCase.java:166)
    at junit.framework.TestCase.runBare(TestCase.java:140)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:131)
    at junit.framework.TestSuite.runTest(TestSuite.java:173)
    at junit.framework.TestSuite.run(TestSuite.java:168)
    at junit.swingui.TestRunner$17.run(TestRunner.java:644)

-- 
Ramy Mamdouh Kamel
Software Engineer
Ute Imkenberg
ramy at imkenberg.net






More information about the jdom-interest mailing list