1

Right now I am working on XMLTask using java 1.6. It is working fine with 1.6 but when I change from 1.6 to 1.7, it is throwing the following error:

NoClassDefFoundError: org/apache/xpath/XPathAPI
Toon Krijthe
  • 52,876
  • 38
  • 145
  • 202
yakov.m
  • 13
  • 1
  • 4

2 Answers2

3

Had the same issue. I resolved it by adding xalan (specifically xalan-2.7.1.jar - there may be newer versions but that's what I had on hand) to the classpath when defining the taskdef:

<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask">
    <classpath>
        <pathelement path="${basedir}/lib/xmltask-v1.13.jar"/>
        <pathelement path="${basedir}/lib/xalan-2.7.1.jar"/>
    </classpath>
</taskdef>

This seemed to make things work fine for me.

Scott
  • 888
  • 7
  • 21
2

Replacing an older version of XMLTask with version 1.16 solved this problem for me.

With version 1.16, there's no need to add any Xalan Jar files to the classpath.

Chad Nouis
  • 6,861
  • 1
  • 27
  • 28