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">
            <classpath>
                        <pathelement location="cactus-ant-1.6.1.jar"/>
            </classpath>
      </taskdef>
</project>


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:

BUILD FAILED
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?
Regards,
LVL 5
blackfrancis75Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

objectsCommented:
try putting them in the lib directory of ant.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
blackfrancis75Author Commented:
I tried that and it doesnt help...
0
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(Class.java:1610)
        at java.lang.Class.getDeclaredConstructors(Class.java:1169)


I tries putting the junit jar in the ANT lib directory but this didnt help...
0
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...
0
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.