You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Rhino <rh...@sympatico.ca> on 2004/04/06 18:09:37 UTC

FTP problem in Ant 1.5.3

I'm having a problem with FTP, or more precisely iftp. I hope someone can help.

I am getting:
BUILD FAILED: java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient

when I run the following Ant task:

<!--==================================================================

Define add-in tasks. 

==================================================================--> 

<taskdef name="iftp" classname="net.ipov.ant.ftp.iFtp"/>

<taskdef name="iftp-get" classname="net.ipov.ant.ftp.GetCommand"/>

<taskdef name="iftp-put" classname="net.ipov.ant.ftp.PutCommand"/>

<taskdef name="iftp-mkdir" classname="net.ipov.ant.ftp.MkdirCommand"/>

<taskdef name="iftp-rmdir" classname="net.ipov.ant.ftp.RmCommand"/>

<!--==================================================================

FTP the jars to the server. 

==================================================================--> 

<target name="upload" description="FTP the Jars to the server">

<echo message="Populating ${server.ftp.dir} directory on server"/> 

<iftp server="${server}" username="${userid}" password="${password}" 

description="Populate jar directory on server" 

binary="yes" 

baseDirRemote="${server.ftp.dir}" 

baseDirLocal="${jar.dir}">

<iftp-put rmtdir="/" binary="yes" description="Populate jar directory">

<fileset dir="${jar.dir}" casesensitive="yes" description="Jar file">

<include name="${TipEditor.jar}"/>

<include name="${EventEditor.jar}"/>

<include name="${SDAC_Common.jar}"/>

</fileset>

</iftp-put> 

</iftp> 

</target> 

I feel sure that this is a basic setup kind of question, probably something to do with placement of the iftp jar or something like that. I was just starting to get fluent with Ant a year ago but I haven't touched it since and have forgotten most of what I knew. 

I seem to recall trying the regular Ant FTP task and having problems with it, then being advised that the iftp task was better. It worked quite well at that point but seems to be broken now, probably something to do with the Eclipse upgrades I've done since then. For what it's worth, my eclipse\plugins directory contains an org.apache.ant_1.5.3 directory which in turn contains:
about.html
ant.jar
dbunit.jar
iftp-ant-1.1.2.jar
optional.jar
plugin.properties
plugin.xml

I'm using Eclipse 2.1.3. 

Can anyone tell me what I need to do to get my (i)ftp task working? Also, can anyone advise me on whether the regular FTP task works better than it did last year? 

I would be willing to upgrade to Ant 1.6 if that would help but I need to know what to do. Would I install an org.apache.ant_1.6 in the Eclipse plugins folder and then delete the 1.5.3 folder to avoid conflicts or is it okay to leave the 1.5.3 folder there? Sorry for the dumb question but I've never updated Ant before. 

Rhino
---
rhino1 AT sympatico DOT ca
"If you're getting something for nothing, you're not using your own credit card."

Re: FTP problem in Ant 1.5.3

Posted by Rhino <rh...@sympatico.ca>.
----- Original Message ----- 
From: "Robert r. Sanders" <ro...@ipov.net>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Tuesday, April 06, 2004 12:30 PM
Subject: Re: FTP problem in Ant 1.5.3


> Yeah, the iFTP task (http://oss.ipov.org/iftp-ant/) just wraps the ANT
> FTP task in a more friendly manner (both less xml, and fewer connections).
> The online documents are a little out of date (I just checked and found
> this).  You need to get the commons-net.jar from
> http://jakarta.apache.org/commons/net/index.html   Put that jar into the
> org.apache.ant_1.5.3 plugin directory and everything should work fine.
>
Actually, I found that I had to put the commons-net jar into the
org.apache.ant_1.5.3 plugin directory *AND* add it to the Ant classpath in
Eclipse.

I just mentioned that in case anyone else encounters the same problem.

This didn't solve my new problem though:
[iftp] Error while connecting or logging into FTP Server.

The vagueness of this message is very disappointing since it doesn't give me
any clue as to what might be wrong.

I noticed that iftp has appended a port number of 21 to the server name.
That might might be a problem if port 21 is closed on that machine. Is there
any way to override it with a different port number if that becomes
necessary? I'll see the server administrator shortly to ask about the port
number but knowing the right port number won't help if I don't know how to
specify it in the iftp task ;-)

Also, would it be possible to make the message more explicit about what the
FTP Server didn't like about the connection attempt? I don't know if it's
unhappy with the port number or it doesn't recognize my userid or my
password has expired or any of many other possibilities. (Actually, I know
that my userid and password are correct but in other situations, I could
imagine not being sure of these things and wondering which of them is
causing the problem.)

Sorry, I hope this doesn't seem unduly negative. I'm just trying to make a
constructive suggestion....

Rhino


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: FTP problem in Ant 1.5.3

Posted by "Robert r. Sanders" <ro...@ipov.net>.
Yeah, the iFTP task (http://oss.ipov.org/iftp-ant/) just wraps the ANT 
FTP task in a more friendly manner (both less xml, and fewer connections).
The online documents are a little out of date (I just checked and found 
this).  You need to get the commons-net.jar from 
http://jakarta.apache.org/commons/net/index.html   Put that jar into the 
org.apache.ant_1.5.3 plugin directory and everything should work fine.


Rhino wrote:

> I'm having a problem with FTP, or more precisely iftp. I hope someone 
> can help.
>  
> I am getting:
> BUILD FAILED: java.lang.NoClassDefFoundError: 
> org/apache/commons/net/ftp/FTPClient
>  
> when I run the following Ant task:
>  ...


-- 
    Robert r. Sanders
    Chief Technologist
    iPOV
    www.ipov.net


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org