Hi
Platform - windows XP
Env Variables -
name - ANT_HOME Value - C:\apache-ant-1.6.2
name - JAVA_HOME Value - C:\Program Files\Java\jdk1.5.0_12
name - PATH Value - C:\Program Files\Java
\jdk1.5.0_12\lib;%ANT_HOME%\bin
I've downloaded and dropped the following jar files and copied them
into C:\apache-ant-1.6.2\lib folder.
I didn't do any command line compilation. I read elsewhere that I
don't have to do that.
jakarta-ant-1.4.1-optional.jar
common-net-1.4.1.jar
jakarta-oro-2.0.8.jar
NetComponents.jar
I've followed all internet instructions to solve this problem, yet it
still doesn't work.
What do I do wrong ? I need step by step at this point from the gurus
here as I don't have much time
to debug.
Any help is appreciated.
My build.xml
<?xml version="1.0"?>
<project name="ABC" basedir=".">
<target name="stoptest" depends="check_timestamp,init"
if="timestamp_set"
description="Run after the test">
<antcall target="stopserver"/>
<echo message="sleeping for 1 minutes to wait for the
servers to
stop"/>
<sleep minutes="1"/>
<antcall target="transferdata"/>
</target>
<target name="transferdata">
<echo message="transferring data to ${TEST_REPOSITORY \
$
{CURRENT_TIME}"/>
<echo message = "Inside ftp get ap1: path is $
{TEST_REPOSITORY}\$
{CURRENT_TIME}\rawdata\all_lg\${ap1}"/>
<echo message = "Inside ftp: remote dir is $
{ap_backup_dir}"/>
<echo message = "Inside ftp: server is ${ap1}"/>
<mkdir dir="${TEST_REPOSITORY}\${CURRENT_TIME}\rawdata
\all_lg\$
{ap1}"/>
<!-- Below ftp tag assumes a directory has already
been created --
<ftp
action="get"
server="{ap1}"
userid="${username}"
password="${password}"
remotedir="${ap_backup_dir}"
passive="no"
ignoreNoncriticalErrors="No"
skipFailedTransfers="false">
<fileset dir="${TEST_REPOSITORY}\$
{CURRENT_TIME}\rawdata\all_lg\$
{ap1}">
<include name="**/**"/>
</fileset>
</ftp>
Actual Output
$ ant -DTIME_STAMP=092520071020 stoptest
Buildfile: build.xml
stoptest:
[echo] sleeping for 1 minutes to wait for the servers to stop
transferdata:
[echo] transferring data to \\des\TR\PAC\ABC\1\ERS
tem\092520071020
[echo] Inside ftp get ap1: path is \\des\TR\PAC\ABC\1\ERS
\092520071020\rawdata\all_lg\dm
[echo] Inside ftp: remote dir is /tmp/backup_ap
[echo] Inside ftp: server is dm
BUILD FAILED
C:\Documents and Settings\Zg\Desktop\Tp\in\pt\build.xml:93: The
following error occurred while executing this line:
C:\Documents and Settings\Zg\Desktop\Tp\in\pt\build.xml:354: Could
not
create task or type of type: ftp.
Ant could not find the task or a class this task relies upon.
This is common and has a number of causes; the usual
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file:
- You have misspelt 'ftp'.
Fix: check your spelling.
- The task needs an external JAR file to execute
and this is not found at the right place in the classpath.
Fix: check the documentation for dependencies.
Fix: declare the task.
- The task is an Ant optional task and the JAR file and/or libraries
implementing the functionality were not found at the time you
yourself built your installation of Ant from the Ant sources.
Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to
the
task and make sure it contains more than merely a META-INF/
MANIFEST.MF.
If all it contains is the manifest, then rebuild Ant with the
needed
libraries present in ${ant.home}/lib/optional/ , or
alternatively,
download a pre-built release version from apache.org
- The build file was written for a later version of Ant
Fix: upgrade to at least the latest release version of Ant
- The task is not an Ant core or optional task
and needs to be declared using <taskdef>.
- You are attempting to use a task defined using
<presetdef> or <macrodef> but have spelt wrong or not
defined it at the point of use
Remember that for JAR files to be visible to Ant tasks implemented
in ANT_HOME/lib, the files must be in the same directory or on the
classpath
Please neither file bug reports on this problem, nor email the
Ant mailing lists, until all of these causes have been explored,
as this is not an Ant bug.
Total time: 1 minute 3 seconds
Andrew Thompson - 26 Sep 2007 06:56 GMT
...
>...I need step by step at this point from the gurus
>here as I don't have much time to debug.
I am not sure if it is possible for me to put this
as politely as might be expected on this forum,
but I will give it a shot.
The statement that you need extra help as you
don't have 'time to debug', is not one that is likely
to encourage people to help you. The attitude is
that these discussion forums are not 'help desks'
(despite the word 'help' in the group name).
For urgent matters, or anything in which you need
step-by-step instructions, it might be better to hire
the services of a help-desk or consultant.
Having said that, I will add that..
1) It is probably better to try running ant in the
first instance, on a simpler task like compiling
an 'HelloWorld' example.
2) The FTP task is not one of the core tasks, and
requires extra jar's. The two listed in the documentation
of the task are not mentioned anywhere in your post.
3) Ant 1.6.2 is 'very' old. I had to upgrade the other day
from that to 1.7, but I cannot recall exactly why.

Signature
Andrew Thompson
http://www.athompson.info/andrew/
Roedy Green - 26 Sep 2007 10:46 GMT
to get up to speed on basic ant tasks, see
http://mindprod.com/jgloss/ant.html

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
zw - 26 Sep 2007 19:48 GMT
> Hi
>
[quoted text clipped - 139 lines]
>
> Total time: 1 minute 3 seconds
Additional Info I found using ant - diagnostics.
-------------------------------------------
Tasks availability
-------------------------------------------
image : Missing dependency com.sun.media.jai.codec.FileSeekableStream
cvsversion : Not Available
ftp : Missing dependency org.apache.tools.ant.util.Retryable
jdepend : Missing dependency jdepend.xmlui.JDepend
junit : Missing dependency junit.framework.Test
Where do I get that missing dependency
org.apache.tools.ant.util.Retryable ?
Thank you
Lew - 26 Sep 2007 21:41 GMT
Lew wrote:
>> Please do not post the same message independently
>> more than once ("multi-post"). You can cross-post
[quoted text clipped - 6 lines]
>>
>> GIYF if you want to learn more about this notion.
zw wrote,
> How do I do that ie setup follow up?
> I'm new to this
Read the instructions for your newsgroup client. I have no idea. I don't
even know what newsgroup client you use. That's why I suggested that you
Google for it.
I participate in this group to discuss Java matters.

Signature
Lew
Roedy Green - 26 Sep 2007 22:56 GMT
>Where do I get that missing dependency
>org.apache.tools.ant.util.Retryable ?
see http://mindprod.com/jgloss/ant.html#EXTRALIBRARIES
Your question has been answered twice already. Please read the
responses thoroughly before asking followup questions. It can get
under a responder's skin if he/she thinks you did not even open
his/her "gift". What point in giving you more?

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com