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
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.
 
 
subject: Connection is closed by foreign host given by Ant SCP task