Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ant + scp

 
neeraj nandwana
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am trying to push a file to server by sftp but i am getting error

scp.deploy:
[scp] Connecting to x.x.x.x:22
[scp] Sending: myfile.txt : 20
[scp] File transfer time: 0.97 Average Rate: 20.66 B/s

BUILD FAILED
com.jcraft.jsch.JSchException: 2: No such file
at org.apache.tools.ant.taskdefs.optional.ssh.ScpToMessageBySftp.doSingleTransfer(ScpToMessageBySftp.java:137)
at org.apache.tools.ant.taskdefs.optional.ssh.ScpToMessageBySftp.execute(ScpToMessageBySftp.java:125)
........


here is my code


and i am using
Apache Ant version 1.7.1
Java version: 1.5
jsch-0.1.42.jar

Any help please

Thanks in advance

 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Run ant in debug mode, it should give you more info.
 
neeraj nandwana
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Martijn for reply
i am running ant in debug mode and it's showing this extra information


Apache Ant version 1.7.1 compiled on June 27 2008
Buildfile: build.xml
Adding reference: ant.PropertyHelper
Detected Java version: 1.5 in: C:\Program Files\Java\jdk1.5.0_09\jre
Detected OS: Windows XP
Adding reference: ant.ComponentHelper
Setting ro project property: ant.file -> D:\test\upload\build.xml
Adding reference: ant.projectHelper
Adding reference: ant.parsing.context
Adding reference: ant.targets
parsing buildfile D:\test\upload\build.xml with URI = file:/D:/test/upload/build.xml
Setting ro project property: ant.project.name -> alogix
Adding reference: alogix
Setting ro project property: ant.file.alogix -> D:\test\upload\build.xml
Project base dir set to: D:\test\upload
+Target:
+Target: scp.about
+Target: scp.config
+Target: scp.deploy
[antlibrg.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found.
Setting project property: ant.configFile -> D:\test\upload\antconfig.txt
Setting project property: scp.server -> 10.52.107.142:22
Setting project property: scp.dir -> /u/username/builds/
Setting project property: scp.password -> password
Setting project property: scp.user -> username
Attempting to create object of type org.apache.tools.ant.helper.DefaultExecutor
Adding reference: ant.executor
Build sequence for target(s) `scp.deploy' is [scp.about, scp.config, scp.deploy]
Complete build sequence is [scp.about, scp.config, scp.deploy, ]
...


but still can't figure it out what is the problem.
host is running on SunOs and i am using sftp to upload the file.
Is some problem with the authentication ???
Any guess ...

 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to check the section of the log in debug mode where it tries to upload the file, you should see it try to resolve the full path to your file before uploading it. You want to make sure that that path is correct first.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic