Using CactusTask in Ant1.6

Hi, Im having real trouble using the CactusTask in Ant1.6, as a minimal test, I have the following ant script;

<project name="Cactus Test" default="init" basedir=".">
      <taskdef name="cactus" classname="org.apache.cactus.integration.ant.CactusTask">
                        <pathelement location="cactus-ant-1.6.1.jar"/>

now I have put cactus-ant-1.6.1.jar in the working dir and verified that org.apache.cactus.integration.ant.CactusTask is in it.
But when i run it i still get the following:

file:C:/projects/Enterprise/CactusTests/build.xml:3: taskdef class org.apache.cactus.integration.ant.CactusTask cannot be found

Does anyone have any idea why this doesnt work?
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

objectsConnect With a Mentor Commented:
try putting them in the lib directory of ant.
blackfrancis75Author Commented:
I tried that and it doesnt help...
blackfrancis75Author Commented:
further to this problem, i just ran it with ant - verbose on and I got this:

--- Nested Exception ---
java.lang.NoClassDefFoundError: junit/framework/TestListener
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(
        at java.lang.Class.getDeclaredConstructors(

I tries putting the junit jar in the ANT lib directory but this didnt help...
blackfrancis75Author Commented:
I found this in the JUnit doco:

Note: You must have junit.jar and the class files for the <junit> task in the same classpath. You can do one of:

1.Put both junit.jar and the optional tasks jar file in ANT_HOME/lib.
2.Do not put either in ANT_HOME/lib, and instead include their locations in your CLASSPATH environment variable.
3.Do neither of the above, and instead, specify their locations using a <classpath> element in the build file. See the FAQ for details.

I tried all three of these to no avail...
blackfrancis75Author Commented:
OK well i have resolved this - Im not sure what was wrong but I installed a completely new version of ANT and moved the JUnit jar file into ANT\lib and it seems to work ok now.
All Courses

From novice to tech pro — start learning today.