aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Problem: failed to create task or type for Cause: The name is undefined. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Problem: failed to create task or type for Cause: The name is undefined." Watch "Problem: failed to create task or type for Cause: The name is undefined." New topic
Author

Problem: failed to create task or type for Cause: The name is undefined.

zabin shariff
Greenhorn

Joined: Jun 03, 2010
Posts: 17
Hi there

I was trying to iterate a list using for tag in my build.xml. But getting this error:



My build .xml looks like this:


Can anybody tell where I am doing wrong

FYI: I am using eclipse 3.5 which has ANT3.7
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Is the for task a standard task in ANT?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The "for" task is in ant-contrib. Have you installed it correctly? Have you provided a taskdef for it that you're not showing here?

http://ant-contrib.sourceforge.net/
zabin shariff
Greenhorn

Joined: Jun 03, 2010
Posts: 17
Hi

It seems I have not provided a typedef for "for" . I corrected myself and changed my code to this:


I got this error:


So I checked the plugins library in eclipse folder and found that there is no ant-lib there. So I downloaded one and copied it to the lib folder of the ant plugin. But still I am getting the same error. Do I need to set the path somewhere. I am using Eclipse Galileo 3.5 which has ANT as plugin so i haven't downloaded ANT and configured it in my system manually.
Any suggestions
zabin shariff
Greenhorn

Joined: Jun 03, 2010
Posts: 17
Hi there
I got the solution
I imported the jar(ant-contrib-1.0b3 which I have downloaded and kept in eclipse/plugins/org.apache.ant_1.7.1.v20090120-1145/lib) in Eclipse, by Windows--?Preferences-->Ant-->Runtime--->Add External Jars in Ant Home Entries.
Now my build.xml is working fine:
Here is my snippet:

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Glad to hear you got it working!
John Kaplan
Greenhorn

Joined: Sep 19, 2009
Posts: 2
One more addition - sometimes ant is thick about finding its lib directory, so it doesn't look like you added the ant-contrib-jar even when you did.
One way to check that is to add a -lib <hard path to your ant lib directory> to the end of your ant command line & see if this problem goes away.
If so, ant is looking in the wrong lib directory on your system.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem: failed to create task or type for Cause: The name is undefined.
 
Similar Threads
Hudson Ant SVN
Jikes in Ant
Problem running ant script chapter 1 of ejb 3 in action with weblogic 10
Getting Exception :Problem: failed to create task or type arg in build.xml while creating webservice
Adding ANT Contrib tasks