• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the for task a standard task in ANT?
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad to hear you got it working!
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic