aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Connection is closed by foreign host given by Ant SCP task Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Connection is closed by foreign host given by Ant SCP task" Watch "Connection is closed by foreign host given by Ant SCP task" New topic
Author

Connection is closed by foreign host given by Ant SCP task

sasank ch
Greenhorn

Joined: Nov 07, 2007
Posts: 25
Hi All,

I am using scp task in my ant build file and target as follows:

<target name="copyFileToRemote">
<scp file="sample.dll" todir="user@host:/shared" port="21" trust="true" password="password" verbose="true"/>
</target>


When i call the "copyFileToRemote" target ,It is giving following error:

[scp] Connecting to host:21
java.lang.Exception: com.jcraft.jsch.JSchException: connection is closed by foreign host


I have tried both ports 21 and 22 also. The remote machine having ftp server and it up and running with read/write permissions.
Could you please guide me to resolve this problem.

Regards,
Sasank
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

SCP != FTP, it needs to have scp enabled.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection is closed by foreign host given by Ant SCP task
 
Similar Threads
SCP task in Ant
Problem with "scp" in ANT build file (Urgent please)
Ant scp task giving Error
FTP Task giving "Connection timed out: connect" Error
possible to have scp task with fileset for files on remote host?