Using format="xml", fails with a NoClassDefFoundError if forked.

  • Share
  • Share

Applies to:
Ant

Description:
Occurs while using Apache Ant.

Cause:
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 task’s .

JAVA-Tools , , , ,

  1. admin
    March 20th, 2009 at 10:28 | #1

    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

    to your task’s .

  1. No trackbacks yet.