remote file transter to windows and unix scp?

Hi,

I have to develop a new software component for a change managment. This component runs on a application server (based on windows 2003) and must copy or excute files on unix and windows. For unix copy I use ftp class of Ant. For windows (from one domain to another). I would like to use Scp but I do not know how I have to build my connect string for an windows domain.

I try to test a connection und get a error 刢onnection refused?

try {

scp = new Scp();

Project project = new Project();

scp.setFile("C:/temp/test.txt");

scp.setTrust(true);

scp.setTodir("test:Test003@de1001.mn-test.de:/D:/temp/");

scp.setProject(project);

scp.execute();

}

catch (Exception exception) {

exception.printStackTrace();

}

om.jcraft.jsch.JSchException: Session.connect: java.net.ConnectException: Connection refused: connect at org.apache.tools.ant.taskdefs.optional.ssh.Scp.execute(Scp.java:187) at com.hannover_re.ct.test.TestCommandsExecutor.testCopy2(TestCommandsExecutor.jav a:310) at com.hannover_re.ct.test.TestCommandsExecutor.main(TestCommandsExecutor.java:41) Caused by: com.jcraft.jsch.JSchException: Session.connect: java.net.ConnectException: Connection refused: connect at com.jcraft.jsch.Session.connect(Unknown Source) at com.jcraft.jsch.Session.connect(Unknown Source) at org.apache.tools.ant.taskdefs.optional.ssh.SSHBase.openSession(SSHBase.java:180 ) at org.apache.tools.ant.taskdefs.optional.ssh.Scp.upload(Scp.java:249) at org.apache.tools.ant.taskdefs.optional.ssh.Scp.execute(Scp.java:176) ...

2 more Nested Exception com.jcraft.jsch.JSchException: Session.connect: java.net.ConnectException: Connection refused: connect at com.jcraft.jsch.Session.connect(Unknown Source) at com.jcraft.jsch.Session.connect(Unknown Source) at org.apache.tools.ant.taskdefs.optional.ssh.SSHBase.openSession(SSHBase.java:180 ) at org.apache.tools.ant.taskdefs.optional.ssh.Scp.upload(Scp.java:249) at org.apache.tools.ant.taskdefs.optional.ssh.Scp.execute(Scp.java:176) at com.hannover_re.ct.test.TestCommandsExecutor.testCopy2(TestCommandsExecutor.jav a:310) at com.hannover_re.ct.test.TestCommandsExecutor.main(TestCommandsExecutor.java:41) Process exited with exit code 0.

Is it the right way to use SCP? How can I realize a solution for my project?

Please help :-)

Thank you for your help.

[2403 byte] By [sonnenanbetera] at [2007-9-23]
# 1
Check the firewall settings on Windows 2003 to make sure that port TCP 22 is open.
lnehrina at 2007-7-11 > top of java,Core,Core APIs...