Dear All, I heard from someone that the spaces in the classpath might be the reason behind the error message that I was getting while attempting to use the for task from ant-contrib. I, therefore, put the directories for ANT_HOME and ant-contrib directly under "C:". Despite doing this, I am still stuck at the same error message :(.
Following are the details of the code (from ant docs), error message, ant diagnostics, and classpath. Do you see anything wrong with the settings? I am using Eclipse 3.3 to run the ant build and have set the classpath to ANT_HOME. Thanks for any help! Ritu ***************ANT CODE***************************************************************************************************************** <project name="Automate" xmlns:ac="antlib:net.sf.antcontrib"> <taskdef resource="/net/sf/antcontrib/antlib.xml"/> <echo message="The first five letters of the alphabet are:"/> <ac:for list="a,b,c,d,e" param="letter"> <sequential> <echo>Letter @{letter}</echo> </sequential> </ac:for> ***************ERROR MESSAGE************************************************************************************************************* Buildfile: C:\AMMA\Eclipse3.3\PDSL\Automate.xml [echo] The file 'C:/AMMA/Eclipse3.3/PDSL/Samples/circuit2.pdsl' has 3 lines. [taskdef] Could not load definitions from resource /net/sf/antcontrib/antlib.xml. It could not be found. [echo] The first five letters of the alphabet are: BUILD FAILED C:\AMMA\Eclipse3.3\PDSL\Automate.xml:34: The following error occurred while executing this line: jar:file:C:/apache-ant-1.8.0/lib/ant-contrib.jar!/net/sf/antcontrib/antlib.xml:3: taskdef A class needed by class net.sf.antcontrib.platform.ShellScriptTask cannot be found: ExecTask using the classloader AntClassLoader[] Total time: 359 milliseconds **************ANT DIAGNOSTICS************************************************************************************************************ c:\Program Files\Microsoft Visual Studio 9.0\VC>ant -diagnostics ------- Ant diagnostics report ------- Apache Ant version 1.8.0 compiled on February 1 2010 ------------------------------------------- Implementation Version ------------------------------------------- core tasks : 1.8.0 in file:/C:/apache-ant-1.8.0/lib/ant.jar optional tasks : 1.8.0 in file:/C:/apache-ant-1.8.0/lib/ant-nodeps.jar ------------------------------------------- ANT PROPERTIES ------------------------------------------- ant.version: Apache Ant version 1.8.0 compiled on February 1 2010 ant.java.version: 1.6 ant.core.lib: C:\apache-ant-1.8.0\lib\ant.jar ant.home: C:\apache-ant-1.8.0 ------------------------------------------- ANT_HOME/lib jar listing ------------------------------------------- ant.home: C:\apache-ant-1.8.0 ant-antlr.jar (5747 bytes) ant-apache-bcel.jar (8749 bytes) ant-apache-bsf.jar (3931 bytes) ant-apache-log4j.jar (3047 bytes) ant-apache-oro.jar (39646 bytes) ant-apache-regexp.jar (3761 bytes) ant-apache-resolver.jar (4074 bytes) ant-apache-xalan2.jar (2293 bytes) ant-commons-logging.jar (3913 bytes) ant-commons-net.jar (85161 bytes) ant-contrib.jar (115287 bytes) ant-jai.jar (22249 bytes) ant-javamail.jar (7855 bytes) ant-jdepend.jar (8265 bytes) ant-jmf.jar (6720 bytes) ant-jsch.jar (40120 bytes) ant-junit.jar (101222 bytes) ant-launcher.jar (12277 bytes) ant-netrexx.jar (9948 bytes) ant-nodeps.jar (402003 bytes) ant-stylebook.jar (2333 bytes) ant-swing.jar (7537 bytes) ant-testutil.jar (15121 bytes) ant-trax.jar (8371 bytes) ant.jar (1506140 bytes) xercesImpl.jar (1223877 bytes) xml-apis.jar (194354 bytes) ------------------------------------------- USER_HOME/.ant/lib jar listing ------------------------------------------- user.home: C:\Documents and Settings\ritu ant-contrib.jar (115287 bytes) ------------------------------------------- Tasks availability ------------------------------------------- image : Missing dependency javax.media.jai.PlanarImage sshexec : Missing dependency com.jcraft.jsch.Logger wlrun : Not Available (the implementation class is not present) scp : Missing dependency com.jcraft.jsch.Logger stlist : Not Available (the implementation class is not present) sshsession : Missing dependency com.jcraft.jsch.Logger starteam : Not Available (the implementation class is not present) stlabel : Not Available (the implementation class is not present) jdepend : Missing dependency jdepend.xmlui.JDepend stcheckin : Not Available (the implementation class is not present) stcheckout : Not Available (the implementation class is not present) ejbc : Not Available (the implementation class is not present) wlstop : Not Available (the implementation class is not present) ddcreator : Not Available (the implementation class is not present) A task being missing/unavailable should only matter if you are trying to use it ------------------------------------------- org.apache.env.Which diagnostics ------------------------------------------- Not available. Download it at http://xml.apache.org/commons/ ------------------------------------------- XML Parser information ------------------------------------------- XML Parser : org.apache.xerces.jaxp.SAXParserImpl XML Parser Location: file:/C:/apache-ant-1.8.0/lib/xercesImpl.jar Namespace-aware parser : org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser Namespace-aware parser Location: file:/C:/apache-ant-1.8.0/lib/xercesImpl.jar ------------------------------------------- XSLT Processor information ------------------------------------------- ***********CLASSPATH INFO******************************************************************************************************** c:\Program Files\Microsoft Visual Studio 9.0\VC>set ANT_HOME=C:\apache-ant-1.8.0 CLASSPATH=.;C:\Program Files\QuickTime\QTSystem\QTJava.zip JAVA_HOME=C:\Program Files\Java\jdk1.6.0_17 Path=c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE;c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN;c:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools ;c:\WINDOWS\Microsoft.NET\Framework\v3.5;c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;c:\Program Files\Microsoft Visual Studio 9.0\VC\VCPackages;C:\Program Files\\Microsof t SDKs\Windows\v6.0A\bin;C:\Perl\site\bin;C:\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Windows Imaging\;C:\WINDOWS\system32\WindowsP owerShell\v1.0;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\PuTTY;C:\Program Files\Common Files\i2 Shared\Geotrans\;C:\Program Files\Matlab\R2009b\bin;C:\Program Files\Matlab\R2009b\bin\win32;c:\DMS\Executables;c:\DMS\Domains\Parlanse\Tools\Compiler;c:\DMS\Domains\Parlanse\Tools\RunTimeSystem;c:\cygwi n\bin;C:\apache-ant-1.8.0\bin ----- Original Message ----- From: "Ritu Ritu" <r...@cis.uab.edu> To: "Ant Users List" <user@ant.apache.org> Sent: Monday, March 22, 2010 5:34:14 AM Subject: Re: Error message while using ant-contrib.jar - "taskdef A class needed by class net.sf.antcontrib.platform.ShellScriptTask cannot be found: ExecTask" P.S. I have already tried the following: 1) copying ant-contrib.jar in the \apache-ant-1.8.0\lib folder 2) removing the namespace xmlns:ac="antlib:net.sf.antcontrib" and specifying "for" instead of "ac:for" 3) specifying the complete path for "resource" in the "typedef" tag. ----- Original Message ----- From: "Ritu Ritu" <r...@cis.uab.edu> To: user@ant.apache.org Sent: Monday, March 22, 2010 5:04:52 AM Subject: Error message while using ant-contrib.jar - "taskdef A class needed by class net.sf.antcontrib.platform.ShellScriptTask cannot be found: ExecTask" Hi All, I am wanting to use for-loop task that is available through ant-contrib.jar but I am getting the error message that is pasted below. By reading the old threads on similar problem (http://www.mail-archive.com/user@ant.apache.org/msg23803.html), I feel that this could be a classpath issue. Any suggestions to fix this problem? Due thanks for any help! Ritu P.S. : I am using Eclipse IDE versions 3.3, Ant version 1.8.0, and ant-contrib-1.0b2. Error Message = BUILD FAILED C:\AMMA\Eclipse3.3\PDSL\Automate.xml:33: The following error occurred while executing this line: jar:file:C:/Documents%20and%20Settings/ritu/.ant/lib/ant-contrib.jar!/net/sf/antcontrib/antlib.xml:3: taskdef A class needed by class net.sf.antcontrib.platform.ShellScriptTask cannot be found: ExecTask using the classloader AntClassLoader[] Code Snippet = <project name="Automate" xmlns:ac="antlib:net.sf.antcontrib"> <typedef resource="net/sf/antcontrib/antlib.xml" classpath="C:/Documents and Settings/ritu/.ant/ant-contrib.jar"/> <loadfile property="src" srcfile="${to}_0.pdsl"/> <ac:for param="line" list="${srcfile}" delimiter="${line.separator}"> <sequential> <mymacro line="@{line}"/>` </sequential> </ac:for> Diagnostics information = C:\AMMA\Eclipse3.3\PDSL>ant -diagnostics ------- Ant diagnostics report ------- Apache Ant version 1.8.0 compiled on February 1 2010 ------------------------------------------- Implementation Version ------------------------------------------- core tasks : 1.8.0 in file:/C:/Program%20Files/apache-ant-1.8.0/lib/ant.jar optional tasks : 1.8.0 in file:/C:/Program%20Files/apache-ant-1.8.0/lib/ant-nodeps.jar ------------------------------------------- ANT PROPERTIES ------------------------------------------- ant.version: Apache Ant version 1.8.0 compiled on February 1 2010 ant.java.version: 1.6 ant.core.lib: C:\Program Files\apache-ant-1.8.0\lib\ant.jar ant.home: C:\Program Files\apache-ant-1.8.0 ------------------------------------------- ANT_HOME/lib jar listing ------------------------------------------- ant.home: C:\Program Files\apache-ant-1.8.0 ant-antlr.jar (5747 bytes) ant-apache-bcel.jar (8749 bytes) ant-apache-bsf.jar (3931 bytes) ant-apache-log4j.jar (3047 bytes) ant-apache-oro.jar (39646 bytes) ant-apache-regexp.jar (3761 bytes) ant-apache-resolver.jar (4074 bytes) ant-apache-xalan2.jar (2293 bytes) ant-commons-logging.jar (3913 bytes) ant-commons-net.jar (85161 bytes) ant-jai.jar (22249 bytes) ant-javamail.jar (7855 bytes) ant-jdepend.jar (8265 bytes) ant-jmf.jar (6720 bytes) ant-jsch.jar (40120 bytes) ant-junit.jar (101222 bytes) ant-launcher.jar (12277 bytes) ant-netrexx.jar (9948 bytes) ant-nodeps.jar (402003 bytes) ant-stylebook.jar (2333 bytes) ant-swing.jar (7537 bytes) ant-testutil.jar (15121 bytes) ant-trax.jar (8371 bytes) ant.jar (1506140 bytes) xercesImpl.jar (1223877 bytes) xml-apis.jar (194354 bytes) ------------------------------------------- USER_HOME/.ant/lib jar listing ------------------------------------------- user.home: C:\Documents and Settings\ritu ant-contrib.jar (115287 bytes) ------------------------------------------- Tasks availability ------------------------------------------- image : Missing dependency javax.media.jai.PlanarImage sshexec : Missing dependency com.jcraft.jsch.Logger wlrun : Not Available (the implementation class is not present) scp : Missing dependency com.jcraft.jsch.Logger stlist : Not Available (the implementation class is not present) sshsession : Missing dependency com.jcraft.jsch.Logger starteam : Not Available (the implementation class is not present) stlabel : Not Available (the implementation class is not present) jdepend : Missing dependency jdepend.xmlui.JDepend stcheckin : Not Available (the implementation class is not present) stcheckout : Not Available (the implementation class is not present) ejbc : Not Available (the implementation class is not present) wlstop : Not Available (the implementation class is not present) ddcreator : Not Available (the implementation class is not present) A task being missing/unavailable should only matter if you are trying to use it ------------------------------------------- org.apache.env.Which diagnostics ------------------------------------------- Not available. Download it at http://xml.apache.org/commons/ ------------------------------------------- XML Parser information ------------------------------------------- XML Parser : org.apache.xerces.jaxp.SAXParserImpl XML Parser Location: file:/C:/Program%20Files/apache-ant-1.8.0/lib/xercesImpl.jar Namespace-aware parser : org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser Namespace-aware parser Location: file:/C:/Program%20Files/apache-ant-1.8.0/lib/xercesImpl.jar ------------------------------------------- XSLT Processor information ------------------------------------------- Big Picture = What I am trying to do with the ant script is as follows: I am searching for certain lines in a file, and if the lines are found they should be written to an output file. Because I need to write each matching line in a separate file, I am using a for-loop. A sample scenario: 1) Content of File.asl = readInt(x) readInt(y) readDouble(z) writeInt(x) sumInt(x,y) 2) Run ant script and extract lines with read* and write them to separate files. Contents of output1.asl = readInt(x) Contents of output2.asl = readInt(y) Contents of output3.asl = readDouble(z) --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org