Hello, I am trying to copy my local file to remote host(windows box) using the following syntax in ANT build file: <scp todir="naveen:email@example.com/d$/test" trust="true"> <fileset dir="naveencopy"/> </scp>
But getting the following error [scp] Connecting to 172.17.5.113:22 BUILD FAILED C:\Documents and Settings\miracle\Desktop\Ant\windows.xml:12: com.jcraft.jsch.JSchException: java.net.ConnectException: Connection timed out: connect Total time: 2 seconds
Can any one help me. Your help would be appreciated.
Hello Jai, Thanks for your sincere advice. And the port 22 is being opened. Do I need to do anything else? Am I correct at using <scp> in ant to copy my local files to remote windows machine? The syntax in todir="user assword@host:/d$/dir" is correct?
It is showing Connection Refused if the remote machine is Windows, If the remote machine is Linux, it is showing connection time out.
Thank you very much. [ May 08, 2008: Message edited by: Naveen Kumar Paila ]
Probably it's the "D$". A dollar sign is the indicator that the name of an Ant property (variable) follows, so to use a dollar sign as part of a filename, you'd have to escape it.
Of course there's also the issue that sharenames ending with "$" are technically not public - it's better to assign an more meaningful name and share that name. But I don't think it actually forbids access to use D$, just hides it from the network browser.
An IDE is no substitute for an Intelligent Developer.
Naveen Kumar Paila
Joined: May 07, 2008
Hello Tim, Thanks for your reply, and I also have the same issue while playing with Unix box as remote. And I need it to be worked on Windows as my production box is Windows. In this case do I need to have a shared folder? or disk to be shared? So in the case of putting files into a remote machine I need to eliminate the use of "$". Is that right? It did not help me... Any other suggestion please? Is that the problem with my jar or anything?
If there was no SSH daemon running on the UNIX machine, you'd see a "Connection refused" message, not a timeout message. The only way you're going to get a timeout message is if the network packets aren't actually making it to/from the server machine; perhaps there's a firewall in the way. Can you connect directly to the server using a Windows SSH client?
As far as the connection refused message you're getting from the Windows server: that suggests strongly that the Windows server isn't running an ssh daemon. Again, if you could connect to that machine directly using a Windows ssh client like Putty, that would tell us something.
Hi, But I am getting Connection Time out message on Unix box. For windows it is Connection refused. Whatever, I need it to work for windows to windows boxes. My requirement is I wanna put my local file or directory in to remote windows machine using ANT script. I am trying to use <scp todir="username :p assword@hostname:/D$/test/" trust="true"> Will it work? Or there is any other method to achieve my requirement?
I suggested that you get a Windows SCP client and attempt to use it to connect to your server machines (both the Windows one and the UNIX one.) If you can't connect with something like PuTTY, then the problem has nothing to do with Ant -- it's something else. The error messages suggest that a firewall is blocking access to the UNIX server, and that the Windows server is not running an ssh daemon. Until you take down the firewall, and run an ssh daemon on the Windows server, neither Ant nor PuTTY will be able to connect. Do you understand what I'm saying now?
Naveen Kumar Paila
Joined: May 07, 2008
Ernest, Thanks a lot, now I am able to work with Linux box, Now I need to work it with Windows. You said run ssh. I have cygwin in my system, and am not able to connect to Windows. Now I believe that I will definitely get solution from you.. I will be thankful to you. How to run ssh on windows machine?
author and iconoclast
To do what I am going to describe, you'd need Cygwin installed on the *server* Windows machine, not the one where Ant is running. Install cygwin, and then run the "sshd" program as a service on that machine. Google found this tutorial to do it:
Hi Now I am able to connect I hope. But build failed, and it is showing "No response from Server". I installed openSSH on my windows system. SSH is running. I am able to connect to Linux from Windows box using ssh through command prompt, and vice versa. But not using my ANT script. It is showing the following :
BUILD FAILED C:\Documents and Settings\miracle\Desktop\Ant\windows.xml:12: No response from server
Your help made me to get through almost. Thanks, Thank you very much.