aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes NullPointer running junit on DOMElementWriter.encode Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "NullPointer running junit on DOMElementWriter.encode" Watch "NullPointer running junit on DOMElementWriter.encode" New topic
Author

NullPointer running junit on DOMElementWriter.encode

Bob Peterson
Ranch Hand

Joined: Jul 30, 2004
Posts: 47
Hi,

I'm trying to run junit from ant. My ant build is 1.6.2. I'm getting the error below. I googled this and found very little, the only suggestion I found was that the problem was caused by multiple installations of ant on classpath. I'm running it from the command line and have tried running it in verbose mode to see the classpath and I don't see multiple ants there.

Also, when I run it from inside eclipse, it still can't find the junit task. Maybe that sheds some light on what's going on with classpath issues. I had that same problem earlier when running from the command line, but fixed it by adding ant-junit.jar to the %ANT_HOME%/lib directory, where junit.jar is located also.

Appreciate any help. Thanks

(Sorry about the formatting, wasn't sure whether to use code or not)

Error :

[junit] java.lang.NullPointerException
[junit] at org.apache.tools.ant.util.DOMElementWriter.encode(DOMElementWriter.java:174)
[junit] at org.apache.tools.ant.util.DOMElementWriter.write(DOMElementWriter.java:95)
[junit] at org.apache.tools.ant.util.DOMElementWriter.write(DOMElementWriter.java:113)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.endTestSuite(XMLJUnitResultFormatter.java:133)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.fireEndTestSuite(JUnitTestRunner.java:440)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:313)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:656)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:558)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NullPointer running junit on DOMElementWriter.encode