wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes ANT FTP task: Software caused connection abort: connect Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ANT FTP task: Software caused connection abort: connect" Watch "ANT FTP task: Software caused connection abort: connect" New topic
Author

ANT FTP task: Software caused connection abort: connect

prabhat gupta
Greenhorn

Joined: Jun 27, 2007
Posts: 1
I am getting "Software caused connection abort: connect" error when i execute the FTP task in ANT.
I am using the FTP task in Ant and trying to connect to a Windows FTP server in the Intranet via its IP and login details.
the Ant task is as below:

<ftp action="get"
server="10.11.189.21"
userid="Myuserid"
password="MyPassword">
<fileset dir="/temp/docs/designdocs/">
<include name="**/*.doc"/>
</fileset>
</ftp>

I was able to ftp the same server from my windows command prompt by using
C:\ ftp 10.11.189.21
and then giving my userid and password. i was also able to download files from the server.

what could be the reason for this strange error.

I also tried to ftp the server using the java.net package by making a connection using URLConnection and doing IO to download.. but the same error is encountered on calling connect method of URLConnection.

I tried using the SCP task in Ant which is used for connecting to servers running Secured Shell. But since the windows ftp server is not behind any firewall(I checked it) this will not work anyways and it surely didn't.

I need to achieve unsecured FTP connection with the Windows FTP Server.

Please let me know the reasons for the problem and possible solutions.
Sumit Ranjan
Greenhorn

Joined: Dec 20, 2005
Posts: 24
I am getting "Software caused connection abort: connect" error when i execute the FTP task in ANT.
I am using the FTP task in Ant and trying to connect to a Windows FTP server in the Intranet via its IP and login details.
the Ant task is as below:

<ftp action="get"
server="10.11.189.21"
userid="Myuserid"
password="MyPassword">
<fileset dir="/temp/docs/designdocs/">
<include name="**/*.doc"/>
</fileset>
</ftp>

I was able to ftp the same server from my windows command prompt by using
C:\ ftp 10.11.189.21
and then giving my userid and password. i was also able to download files from the server.

what could be the reason for this strange error.

I also tried to ftp the server using the java.net package by making a connection using URLConnection and doing IO to download.. but the same error is encountered on calling connect method of URLConnection.

I tried using the SCP task in Ant which is used for connecting to servers running Secured Shell. But since the windows ftp server is not behind any firewall(I checked it) this will not work anyways and it surely didn't.

I need to achieve unsecured FTP connection with the Windows FTP Server.

Please let me know the reasons for the problem and possible solutions
----------------------------------------------------------------------------

Dear Prabhat,

I think you are getting this error because to be able to do tasks like FTP, telnet etc you would need to download addtional jars
and put them in your ANT_HOME/lib folder.In your case you would need these jars -
i) commons-net-1.4.1.jar
ii)jakarta-oro-2.0.8.jar.
You can download these jars from this site - http://ant.apache.org/manual/install.html
(U will have to scroll down to the section Library Dependencies)

Please let me know if this solves your problem.

Thanks and Regards,
Sumit
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ANT FTP task: Software caused connection abort: connect
 
Similar Threads
Remote deployment to a unix server using FTP task in ANT
error during FTP transfer: org apache commons net MalformedServerReplyException
NoClassDefFoundError
unable to create directory using ftp task
FTP Task giving "Connection timed out: connect" Error