[jdom-interest] Strange ClassCastException when running beta7 under ant

bob mcwhirter bob at werken.com
Sun Aug 12 21:15:17 PDT 2001


Honestly, I think this is an Ant problem.  Seen it a few times
with jdom, dom4j, jaxen and other packages.

Add a fork="true" to your <java> task, and they seem to go away.

I think Ant has some bungled classloading going on.

	-bob


On Mon, 13 Aug 2001, Matthew Cooper wrote:

> I was happily running junit tests under ant with the previous jdom version 
> (before beta 7). When I upgraded to  beta 7 i get this root cause exception.
> 
>     [junit] Root cause: java.lang.ClassCastException: 
> org.apache.xerces.parsers.SAXParser    [junit]     at 
> org.jdom.input.SAXBuilder.createParser(SAXBuilder.java:392)
>     [junit]     at org.jdom.input.SAXBuilder.build(SAXBuilder.java:283)
>     [junit]     at org.jdom.input.SAXBuilder.build(SAXBuilder.java:650)
>     [junit]     at 
> com.cloverworxs.io.XMLHandler.xmlToElements(XMLHandler.java:172)
>     [junit]     at 
> com.cloverworxs.io.TestXMLHandler.testToXMLValue(TestXMLHandler.java:111)
>     [junit]     at java.lang.reflect.Method.invoke(Native Method)
>     [junit]     at junit.framework.TestCase.runTest(TestCase.java:156)
>     [junit]     at junit.framework.TestCase.runBare(TestCase.java:130)
>     [junit]     at junit.framework.TestResult$1.protect(TestResult.java:106)
>     [junit]     at 
> junit.framework.TestResult.runProtected(TestResult.java:124)
>     [junit]     at junit.framework.TestResult.run(TestResult.java:109)
>     [junit]     at junit.framework.TestCase.run(TestCase.java:121)
>     [junit]     at junit.framework.TestSuite.runTest(TestSuite.java:157)
>     [junit]     at junit.framework.TestSuite.run(TestSuite.java:152)
>     [junit]     at 
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:209)
>     [junit]     at 
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.executeInVM(JUnitTask.java:409)
>     [junit]     at 
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:283)
>     [junit]     at 
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTask.execute(JUnitTask.java:263)
>     [junit]     at org.apache.tools.ant.Target.execute(Target.java:153)
>     [junit]     at org.apache.tools.ant.Project.runTarget(Project.java:898)
>     [junit]     at 
> org.apache.tools.ant.Project.executeTarget(Project.java:536)
>     [junit]     at 
> org.apache.tools.ant.Project.executeTargets(Project.java:510)
>     [junit]     at org.apache.tools.ant.Main.runBuild(Main.java:421)
>     [junit]     at org.apache.tools.ant.Main.main(Main.java:149)
>     [junit]
> 
> If I run the junit test outside of ant it runs fine. I have currently 
> reverted to the previous jdom version so that I can carry on.
> 
> The line causing the problem is casting to an XMLHandler, which 
> org.apache.xerces.parsers.SAXParser is (whichever version of jdom I am 
> running of course).
> 
> Any ideas as to what's going on here?
> 
> Thanks, Matty.
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
> 




More information about the jdom-interest mailing list