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 2005/12/17 18:34:45 UTC

FTP problems

I need some help with an FTP problem in an Ant task. I am running Ant 1.6.5 
from Eclipse 3.1.1.

I have a task that is trying to FTP some files from my computer to a remote 
server. I am getting this error from the task:

upload-Sympatico:

[echo] Uploading to Sympatico....

[echo] Deleting all files (but not subdirectories) *beneath* the resume 
directory.

[ftp] Opening FTP connection to www3.sympatico.ca

[antcall] Exiting 
E:\eclipse\3.1.1\eclipse\workspace\Resume_JDK_1.5.0\xml\build.xml.

BUILD FAILED

E:\eclipse\3.1.1\eclipse\workspace\Resume_JDK_1.5.0\xml\build.xml:304: The 
following error occurred while executing this line:

java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient

at 
org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:539)

at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:384)

at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)

at org.apache.tools.ant.Task.perform(Task.java:364)

at org.apache.tools.ant.Target.execute(Target.java:341)

at org.apache.tools.ant.Target.performTasks(Target.java:369)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)

at org.apache.tools.ant.Project.executeTarget(Project.java:1185)

at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)

at 
org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)

at org.apache.tools.ant.Project.executeTargets(Project.java:1068)

at 
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)

at 
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)

Caused by: java.lang.NoClassDefFoundError: 
org/apache/commons/net/ftp/FTPClient

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1225)

at 
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)

at 
org.eclipse.ant.internal.ui.antsupport.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)

at org.apache.tools.ant.Project.executeTargets(Project.java:1068)

at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)

... 12 more

Caused by: java.lang.NoClassDefFoundError: 
org/apache/commons/net/ftp/FTPClient

at org.apache.tools.ant.taskdefs.optional.net.FTP.execute(FTP.java:1943)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)

at org.apache.tools.ant.Task.perform(Task.java:364)

at org.apache.tools.ant.Target.execute(Target.java:341)

at org.apache.tools.ant.Target.performTasks(Target.java:369)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)

... 16 more

--- Nested Exception ---

java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1225)

at 
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)

at 
org.eclipse.ant.internal.ui.antsupport.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)

at org.apache.tools.ant.Project.executeTargets(Project.java:1068)

at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)

at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)

at org.apache.tools.ant.Task.perform(Task.java:364)

at org.apache.tools.ant.Target.execute(Target.java:341)

at org.apache.tools.ant.Target.performTasks(Target.java:369)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)

at org.apache.tools.ant.Project.executeTarget(Project.java:1185)

at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)

at 
org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)

at org.apache.tools.ant.Project.executeTargets(Project.java:1068)

at 
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)

at 
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)

Caused by: java.lang.NoClassDefFoundError: 
org/apache/commons/net/ftp/FTPClient

at org.apache.tools.ant.taskdefs.optional.net.FTP.execute(FTP.java:1943)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)

at org.apache.tools.ant.Task.perform(Task.java:364)

at org.apache.tools.ant.Target.execute(Target.java:341)

at org.apache.tools.ant.Target.performTasks(Target.java:369)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)

... 16 more

--- Nested Exception ---

java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient

at org.apache.tools.ant.taskdefs.optional.net.FTP.execute(FTP.java:1943)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)

at org.apache.tools.ant.Task.perform(Task.java:364)

at org.apache.tools.ant.Target.execute(Target.java:341)

at org.apache.tools.ant.Target.performTasks(Target.java:369)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)

at 
org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)

at 
org.eclipse.ant.internal.ui.antsupport.EclipseSingleCheckExecutor.executeTargets(EclipseSingleCheckExecutor.java:30)

at org.apache.tools.ant.Project.executeTargets(Project.java:1068)

at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)

at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)

at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)

at org.apache.tools.ant.Task.perform(Task.java:364)

at org.apache.tools.ant.Target.execute(Target.java:341)

at org.apache.tools.ant.Target.performTasks(Target.java:369)

at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)

at org.apache.tools.ant.Project.executeTarget(Project.java:1185)

at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)

at 
org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)

at org.apache.tools.ant.Project.executeTargets(Project.java:1068)

at 
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)

at 
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)

I've checked and I have:
- org.apache.ant_1.6.5 in my 'plugins' directory within Eclipse
- commons-net-1.4.1.jar and jakarta-oro-2.0.8.jar in the 'lib' directory 
beneath the Ant plugin, i.e. in org.apache.ant_1.6.5\lib

That suggests that this is _not_ an installation issue but I don't know what 
else could be wrong. I've already verified that the server is accessible, 
that I gave the correct userid and password, and that the target directory 
exists.

Can anyone help me debug this problem?

Rhino



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 16/12/2005


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


Re: FTP problems

Posted by Rhino <rh...@sympatico.ca>.
----- Original Message ----- 
From: "Antoine Levy-Lambert" <an...@gmx.de>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Saturday, December 17, 2005 2:09 PM
Subject: Re: FTP problems


> Hello Rhino,
>
> please read the section installing ant / library dependencies of the 
> manual.
>
> To run ftp, you need commons-net and oro.
>
> The error message you have posted indicates that you do not have
> commons-net.
>
>> java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
>>
As I said in my first message, I _do_ have commons-net and oro in the 'lib' 
directory of Ant. Here are the exact names of the jars:
- commons-net-1.4.1.jar
- jakarta-oro-2.0.8.jar

Next guess?

Rhino



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 16/12/2005


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


Re: FTP problems

Posted by Rhino <rh...@sympatico.ca>.
Thank you VERY much, Gilbert!

That did the trick. I had completely forgotten the need to take that step in 
Eclipse.

Rhino

----- Original Message ----- 
From: "Gilbert Rebhan" <an...@schillbaer.de>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Saturday, December 17, 2005 3:20 PM
Subject: Re: FTP problems


> Hi, Rhino
>
>> What more do I need to do/check then?
>
> Check if those needed jar's are in sight
> for ant in eclipse.
>
> -> Window|Preferences|Ant|Runtime|Global Entries|Add External Jars
> and choose from filesystem
> or Add Jars if you put them into a project in your workspace
>
>> ----- Original Message ----- From: "Jeffrey E Care" <ca...@us.ibm.com>
>> To: "Ant Users List" <us...@ant.apache.org>
>> Cc: "Ant Users List" <us...@ant.apache.org>
>> Sent: Saturday, December 17, 2005 2:39 PM
>> Subject: Re: FTP problems
>>
>>
>>> Since you are running this in the Eclipse environment something else to
>>> make sure of is that commons-net & oro are actually on the Ant classpath
>>> _as used by Eclipse_ ; I don't think just dropping the JARs in the Ant
>>> plugin's "lib" directory is enough.
>
> bye4now, Gilbert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 16/12/2005
>
> 



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 16/12/2005


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


Re: Re: FTP problems

Posted by mo...@gmail.com.
Hi Every one,

It was great help going through the messages.
I am stuck at one point.

I am getting an error in ant ftp task.

error during FTP transfer: java.net.ConnectException: Connection refused: connect

can any one help me out on this issue..

thanks
Hamed.



--
This message was sent on behalf of mohdhamedmscse@gmail.com at openSubscriber.com
http://www.opensubscriber.com/message/user@ant.apache.org/2866540.html

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


Re: FTP problems

Posted by Jeffrey E Care <ca...@us.ibm.com>.
You can also add them to the classpath for each "run configuration" by 
clicking on the classpath tab.

Run | External tools | External tools...

JEC
-- 
Jeffrey E. Care (carej@us.ibm.com)
WebSphere v7 Release Engineer
WebSphere Build Tooling Lead (Project Mantis)


Gilbert Rebhan <an...@schillbaer.de> wrote on 12/17/2005 03:20:18 PM:

> Hi, Rhino
> 
> > What more do I need to do/check then?
> 
> Check if those needed jar's are in sight
> for ant in eclipse.
> 
> -> Window|Preferences|Ant|Runtime|Global Entries|Add External Jars
> and choose from filesystem
> or Add Jars if you put them into a project in your workspace
> 
> > ----- Original Message ----- From: "Jeffrey E Care" <ca...@us.ibm.com>
> > To: "Ant Users List" <us...@ant.apache.org>
> > Cc: "Ant Users List" <us...@ant.apache.org>
> > Sent: Saturday, December 17, 2005 2:39 PM
> > Subject: Re: FTP problems
> > 
> > 
> >> Since you are running this in the Eclipse environment something else 
to
> >> make sure of is that commons-net & oro are actually on the Ant 
classpath
> >> _as used by Eclipse_ ; I don't think just dropping the JARs in the 
Ant
> >> plugin's "lib" directory is enough.
> 
> bye4now, Gilbert
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Re: FTP problems

Posted by Gilbert Rebhan <an...@schillbaer.de>.
Hi, Rhino

> What more do I need to do/check then?

Check if those needed jar's are in sight
for ant in eclipse.

-> Window|Preferences|Ant|Runtime|Global Entries|Add External Jars
and choose from filesystem
or Add Jars if you put them into a project in your workspace

> ----- Original Message ----- From: "Jeffrey E Care" <ca...@us.ibm.com>
> To: "Ant Users List" <us...@ant.apache.org>
> Cc: "Ant Users List" <us...@ant.apache.org>
> Sent: Saturday, December 17, 2005 2:39 PM
> Subject: Re: FTP problems
> 
> 
>> Since you are running this in the Eclipse environment something else to
>> make sure of is that commons-net & oro are actually on the Ant classpath
>> _as used by Eclipse_ ; I don't think just dropping the JARs in the Ant
>> plugin's "lib" directory is enough.

bye4now, Gilbert

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


Re: FTP problems

Posted by Rhino <rh...@sympatico.ca>.
What more do I need to do/check then?

Rhino

----- Original Message ----- 
From: "Jeffrey E Care" <ca...@us.ibm.com>
To: "Ant Users List" <us...@ant.apache.org>
Cc: "Ant Users List" <us...@ant.apache.org>
Sent: Saturday, December 17, 2005 2:39 PM
Subject: Re: FTP problems


> Since you are running this in the Eclipse environment something else to
> make sure of is that commons-net & oro are actually on the Ant classpath
> _as used by Eclipse_ ; I don't think just dropping the JARs in the Ant
> plugin's "lib" directory is enough.
>
> -- 
> Jeffrey E. Care (carej@us.ibm.com)
> WebSphere v7 Release Engineer
> WebSphere Build Tooling Lead (Project Mantis)
>
>
> "Antoine Levy-Lambert" <an...@gmx.de> wrote on 12/17/2005 02:09:38 PM:
>
>> Hello Rhino,
>>
>> please read the section installing ant / library dependencies of the
> manual.
>>
>> To run ftp, you need commons-net and oro.
>>
>> The error message you have posted indicates that you do not have
>> commons-net.
>>
>> > java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
>> >
>> > at
>>
>> Cheers,
>>
>> Antoine
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>


--------------------------------------------------------------------------------


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 16/12/2005



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.1/206 - Release Date: 16/12/2005


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


Re: FTP problems

Posted by Jeffrey E Care <ca...@us.ibm.com>.
Since you are running this in the Eclipse environment something else to 
make sure of is that commons-net & oro are actually on the Ant classpath 
_as used by Eclipse_ ; I don't think just dropping the JARs in the Ant 
plugin's "lib" directory is enough.

-- 
Jeffrey E. Care (carej@us.ibm.com)
WebSphere v7 Release Engineer
WebSphere Build Tooling Lead (Project Mantis)


"Antoine Levy-Lambert" <an...@gmx.de> wrote on 12/17/2005 02:09:38 PM:

> Hello Rhino,
> 
> please read the section installing ant / library dependencies of the 
manual.
> 
> To run ftp, you need commons-net and oro.
> 
> The error message you have posted indicates that you do not have
> commons-net.
> 
> > java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
> >
> > at
> 
> Cheers,
> 
> Antoine
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Re: FTP problems

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello Rhino,

please read the section installing ant / library dependencies of the manual.

To run ftp, you need commons-net and oro.

The error message you have posted indicates that you do not have
commons-net.

> java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient
>
> at

Cheers,

Antoine



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