• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

error during FTP transfer: org apache commons net MalformedServerReplyException

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I tried to ftp a ear file to a UNIX box from my windows machine, I got the error as :

BUILD FAILED
C:\newWorkspace\DNAHitsEJB\build.xml:163: error during FTP transfer: org.apache.commons.net.MalformedServerReplyException: Could not parse response code.
Server Reply: SSH-2.0-Sun_SSH_1.1

Here is my code in build.xml :

<target name="CopyToUnix" >
<ftp userid="weblogic" password="weblogic" server="unix-dev-5" port="22" remotedir="/opt/bea/weblogic92/user_projects/domains/mydomain/upload" passive="true" timediffauto="true" >
<fileset dir="${workspace.jar.dir}">
<include name="${app.name}.ear"/>
</fileset>
</ftp>
</target>

I tried to FTP by using the same userid-password via PUTTY and also via SSH, however both worked fine. Why the same is not working through ANT ?
What is the reason behind this ? Any kind of help is appreciated.
 
prasad kulkarni
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok I solved this by using scp command of ant.

<scp file="${workspace.deploy.dir}/${app.name}.ear" todir="weblogic:weblogic@myserver:/opt/bea/weblogic92/user_projects/mydoman/upload"
port="22" trust="true"/>

Note : Do not forget to set property -> trust="true"

Also you need one external jar to be included in the ANT classpath.
Name of the jar is -> jsch-0.1.37.jar
 
Saloon Keeper
Posts: 28654
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your problem was that you were trying to FTP to the SSH server on port 22. FTP and SSH are 2 different protocols, just as FTP and HTTP are. You did the right thing when you switched to SCP.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic