As a workaround, run your <java> task with
fork="true" and Ant will display the full
trace.
+
+
+
+ Using format="xml", <junit> fails with a
+ NoClassDefFoundError if forked.
+
+
+
The XML formatter needs the DOM classes to work. If you
+ are using JDK 1.4 or later they are included with your Java
+ Runtime and this problem won't occur. If you are running JDK
+ 1.3 or earlier, the DOM classes have to be on your
+ <junit> task's <classpath>.
+
Prior to Ant 1.6.0 Ant would include the DOM classes from
+ the XML parser that is used by Ant itself if you set the
+ includeAntRuntime attribute to true (the default). With Ant
+ 1.6.0 this has been changed as this behavior made it
+ impossible to use a different XML parser in your tests.
+
This means that you have to take care of the DOM classes
+ explicitly starting with Ant 1.6.0. If you don't need to set
+ up a different XML parser for your tests, the easiest solution
+ is to add
Implicitly add the Ant classes required to run
- the tests and JUnit to the classpath in forked mode.
+ the tests and JUnit to the classpath in forked mode.
+ Note: Please read the Ant FAQ if you
+ want to set this to false and use the XML formatter
+ at the same time.
No; default is true.
@@ -291,6 +295,12 @@ can be specified.
that your tests have written as some characters are illegal in XML
documents and will be dropped.
+
Note: Please read the Ant FAQ if you want to
+set the fork attribute to true, the includeAntRuntime
+attribute to false and use the XML formatter at the same
+time.
+
Attribute
diff --git a/xdocs/faq.xml b/xdocs/faq.xml
index 10d94f842..47c395e2c 100644
--- a/xdocs/faq.xml
+++ b/xdocs/faq.xml
@@ -1435,6 +1435,40 @@ mv /tmp/foo $ANT_HOME/bin/antRun
trace.
+
+
+
+ Using format="xml", <junit> fails with a
+ NoClassDefFoundError if forked.
+
+
+
+
The XML formatter needs the DOM classes to work. If you
+ are using JDK 1.4 or later they are included with your Java
+ Runtime and this problem won't occur. If you are running JDK
+ 1.3 or earlier, the DOM classes have to be on your
+ <junit> task's <classpath>.
+
+
Prior to Ant 1.6.0 Ant would include the DOM classes from
+ the XML parser that is used by Ant itself if you set the
+ includeAntRuntime attribute to true (the default). With Ant
+ 1.6.0 this has been changed as this behavior made it
+ impossible to use a different XML parser in your tests.
+
+
This means that you have to take care of the DOM classes
+ explicitly starting with Ant 1.6.0. If you don't need to set
+ up a different XML parser for your tests, the easiest solution
+ is to add