Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2007

Tip: Looking for answers? Try searching our database.

ANT FTP task Does not work

Thread view: 
zw - 26 Sep 2007 06:37 GMT
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 07:00 GMT
...
>...I need step by step at this point from the gurus
>here as I don't have much time
>to debug.

I see that 'not much time' has translated into a
multi-post.  Please refrain from multi-posting in
future.

Signature

Andrew Thompson
http://www.athompson.info/andrew/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.