You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Karthik <ka...@xius.org> on 2006/02/20 08:31:54 UTC

Ant ,ftp,java

Hi form

On  running the ftp target (in build.xml ) from  java using
"org.apache.tools.ant.*" I ageeint this Exception as below.

============================================================================
================
<target name="TgtName">

   <fileset dir="${libs}">
    <include name="**/*.jar"/>
  </fileset>

  <ftp server="${ftptype}"
       remotedir = "${ftpremotedir}"
    userid = "${ftpid}"
       password = "${ftppas}"
          Port= "22"
       action="put"
    separator="/"
  >
    <fileset dir="${src.dir}">
             <include name="*.txt" />

          </fileset>
     </ftp>
  </target>

error:
--------

D:\TEST\unix.xml:38: error during FTP transfer:
org.apache.commons.net.MalformedServerReplyException: Could not parse
response code.
Server Reply: SSH-1.99-OpenSSH_3.6.1p2
 at org.apache.tools.ant.taskdefs.optional.net.FTP.execute(FTP.java:2014)
 at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
 at org.apache.tools.ant.Task.perform(Task.java:364)
 at org.apache.tools.ant.Target.execute(Target.java:341)
 at org.apache.tools.ant.Target.performTasks(Target.java:369)
 at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
 at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
 at com.xius.copy.os.xnix.FILECOPY1_1.runTarget(FILECOPY1_1.java:43)
 at com.xius.copy.os.xnix.FILECOPY1_1.main(FILECOPY1_1.java:62)

============================================================================
================


but if I run the same FTP tag  from  ant ( ant -buildfile build.xml ),then
the task is  processeed sucessfully.



Note : in both cases I have made shure to set classpath of

commons-net-1.4.1.jar
jakarta-oro-2.0.8.jar



Some body Please tell me why am i getting the error...

with regards
Karthik

Re: Ant ,ftp,java

Posted by Steve Loughran <st...@apache.org>.
Karthik wrote:
> Hi form
> 
> On  running the ftp target (in build.xml ) from  java using
> "org.apache.tools.ant.*" I ageeint this Exception as below.
> 
> ============================================================================
> ================
> <target name="TgtName">
> 
>    <fileset dir="${libs}">
>     <include name="**/*.jar"/>
>   </fileset>
> 
>   <ftp server="${ftptype}"
>        remotedir = "${ftpremotedir}"
>     userid = "${ftpid}"
>        password = "${ftppas}"
>           Port= "22"
>        action="put"
>     separator="/"
>   >

Please read the error text and think about what it means. A bit of 
pondering will save a lot of time compared to posting for help on the 
mailing list and getting back incomplete answers like this one.

> 
> D:\TEST\unix.xml:38: error during FTP transfer:
> org.apache.commons.net.MalformedServerReplyException: Could not parse
> response code.

There was a server response code that could not be parsed

> Server Reply: SSH-1.99-OpenSSH_3.6.1p2

The server response that could not be parsed was "SSH-1.99-OpenSSH_3.6.1p2"

Everything else is left as an exercise for the reader.

-Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Ant ,ftp,java

Posted by Karthik <ka...@xius.org>.
Hi Form

Thx very much ,

u were Right the Port  22 indeed was the  Culprit in my case,


Thx very much.

with regards
Karthik
  -----Original Message-----
  From: Jeffrey E Care [mailto:carej@us.ibm.com]
  Sent: Monday, February 20, 2006 8:28 PM
  To: Ant Users List
  Cc: Ant Users List
  Subject: RE: Ant ,ftp,java



  Are you REALLY sure? Because last time I checked port 22 was SSH, not FTP.
Given the server reply you posted it would indeed seem that you are hitting
an SSH server.

____________________________________________________________________________
________________
        Jeffrey E. (Jeff) Care  carej@us.ibm.com
        IBM WebSphere Application Server Development  WAS Pyxis Lead Release
Engineer




  "Karthik" <ka...@xius.org> wrote on 02/20/2006 09:13:57 AM:

  > Hi Form
  >
  >
  > > but if I run the same FTP tag  from  ant ( ant -buildfile build.xml
  > > ),then  the task is  processeed sucessfully.
  >
  >
  > On running the  same target using "ant -buildfile unix.xml"
  >
  > The ftp access is able to perform sucessfully (on the same port 22)
  >
  >
  > with regards
  > Karthik
  >
  >
  >   -----Original Message-----
  >   From: Jeffrey E Care [mailto:carej@us.ibm.com]
  >   Sent: Monday, February 20, 2006 7:26 PM
  >   To: Ant Users List
  >   Subject: Re: Ant ,ftp,java
  >
  >
  >
  >   Double check your port numbers.
  >
  >
____________________________________________________________________________
  > ________________
  >         Jeffrey E. (Jeff) Care  carej@us.ibm.com
  >         IBM WebSphere Application Server Development  WAS Pyxis Lead
Release
  > Engineer
  >
  >
  >
  >
  >   "Karthik" <ka...@xius.org> wrote on 02/20/2006 02:31:54 AM:
  >
  >   > Hi form
  >   >
  >   > On  running the ftp target (in build.xml ) from  java using  "org.
  >   > apache.tools.ant.*" I ageeint this Exception as below.
  >   >
  >   >
  >
============================================================================
  > ================
  >   > <target name="TgtName">
  >   >
  >   >    <fileset dir="${libs}">
  >   >     <include name="**/*.jar"/>
  >   >   </fileset>
  >   >
  >   >   <ftp server="${ftptype}"
  >   >        remotedir = "${ftpremotedir}"
  >   >     userid = "${ftpid}"
  >   >        password = "${ftppas}"
  >   >           Port= "22"
  >   >        action="put"
  >   >     separator="/"
  >   >   >
  >   >     <fileset dir="${src.dir}">
  >   >              <include name="*.txt" />
  >   >
  >   >           </fileset>
  >   >      </ftp>
  >   >   </target>
  >   >
  >   > error:
  >   > --------
  >   >
  >   > D:\TEST\unix.xml:38: error during FTP transfer: org.apache.commons.
  >   > net.MalformedServerReplyException: Could not parse response code.
  >   > Server Reply: SSH-1.99-OpenSSH_3.6.1p2
  >   >  at
  > org.apache.tools.ant.taskdefs.optional.net.FTP.execute(FTP.java:2014)
  >   >  at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
  >   >  at org.apache.tools.ant.Task.perform(Task.java:364)
  >   >  at org.apache.tools.ant.Target.execute(Target.java:341)
  >   >  at org.apache.tools.ant.Target.performTasks(Target.java:369)
  >   >  at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
  >   >  at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
  >   >  at com.xius.copy.os.xnix.FILECOPY1_1.runTarget(FILECOPY1_1.java:43)
  >   >  at com.xius.copy.os.xnix.FILECOPY1_1.main(FILECOPY1_1.java:62)
  >   >
  >   >
  >
============================================================================
  > ================
  >   >
  >   >
  >   > but if I run the same FTP tag  from  ant ( ant -buildfile build.xml
  >   > ),then  the task is  processeed sucessfully.
  >   >
  >   >
  >   >
  >   > Note : in both cases I have made shure to set classpath of
  >   >
  >   > commons-net-1.4.1.jar
  >   > jakarta-oro-2.0.8.jar
  >   >
  >   >
  >   >
  >   > Some body Please tell me why am i getting the error...
  >   >
  >   > with regards
  >   > Karthik

RE: Ant ,ftp,java

Posted by Jeffrey E Care <ca...@us.ibm.com>.
Are you REALLY sure? Because last time I checked port 22 was SSH, not FTP. 
Given the server reply you posted it would indeed seem that you are 
hitting an SSH server.

____________________________________________________________________________________________ 

Jeffrey E. (Jeff) Care 
carej@us.ibm.com 
IBM WebSphere Application Server Development 
WAS Pyxis Lead Release Engineer 




"Karthik" <ka...@xius.org> wrote on 02/20/2006 09:13:57 AM:

> Hi Form
> 
> 
> > but if I run the same FTP tag  from  ant ( ant -buildfile build.xml
> > ),then  the task is  processeed sucessfully.
> 
> 
> On running the  same target using "ant -buildfile unix.xml"
> 
> The ftp access is able to perform sucessfully (on the same port 22)
> 
> 
> with regards
> Karthik
> 
> 
>   -----Original Message-----
>   From: Jeffrey E Care [mailto:carej@us.ibm.com]
>   Sent: Monday, February 20, 2006 7:26 PM
>   To: Ant Users List
>   Subject: Re: Ant ,ftp,java
> 
> 
> 
>   Double check your port numbers.
> 
> 
____________________________________________________________________________
> ________________
>         Jeffrey E. (Jeff) Care  carej@us.ibm.com
>         IBM WebSphere Application Server Development  WAS Pyxis Lead 
Release
> Engineer
> 
> 
> 
> 
>   "Karthik" <ka...@xius.org> wrote on 02/20/2006 02:31:54 AM:
> 
>   > Hi form
>   >
>   > On  running the ftp target (in build.xml ) from  java using  "org.
>   > apache.tools.ant.*" I ageeint this Exception as below.
>   >
>   >
> 
============================================================================
> ================
>   > <target name="TgtName">
>   >
>   >    <fileset dir="${libs}">
>   >     <include name="**/*.jar"/>
>   >   </fileset>
>   >
>   >   <ftp server="${ftptype}"
>   >        remotedir = "${ftpremotedir}"
>   >     userid = "${ftpid}"
>   >        password = "${ftppas}"
>   >           Port= "22"
>   >        action="put"
>   >     separator="/"
>   >   >
>   >     <fileset dir="${src.dir}">
>   >              <include name="*.txt" />
>   >
>   >           </fileset>
>   >      </ftp>
>   >   </target>
>   >
>   > error:
>   > --------
>   >
>   > D:\TEST\unix.xml:38: error during FTP transfer: org.apache.commons.
>   > net.MalformedServerReplyException: Could not parse response code.
>   > Server Reply: SSH-1.99-OpenSSH_3.6.1p2
>   >  at
> org.apache.tools.ant.taskdefs.optional.net.FTP.execute(FTP.java:2014)
>   >  at 
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>   >  at org.apache.tools.ant.Task.perform(Task.java:364)
>   >  at org.apache.tools.ant.Target.execute(Target.java:341)
>   >  at org.apache.tools.ant.Target.performTasks(Target.java:369)
>   >  at 
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>   >  at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>   >  at com.xius.copy.os.xnix.FILECOPY1_1.runTarget(FILECOPY1_1.java:43)
>   >  at com.xius.copy.os.xnix.FILECOPY1_1.main(FILECOPY1_1.java:62)
>   >
>   >
> 
============================================================================
> ================
>   >
>   >
>   > but if I run the same FTP tag  from  ant ( ant -buildfile build.xml
>   > ),then  the task is  processeed sucessfully.
>   >
>   >
>   >
>   > Note : in both cases I have made shure to set classpath of
>   >
>   > commons-net-1.4.1.jar
>   > jakarta-oro-2.0.8.jar
>   >
>   >
>   >
>   > Some body Please tell me why am i getting the error...
>   >
>   > with regards
>   > Karthik

RE: Ant ,ftp,java

Posted by Karthik <ka...@xius.org>.
Hi Form


> but if I run the same FTP tag  from  ant ( ant -buildfile build.xml
> ),then  the task is  processeed sucessfully.


On running the  same target using "ant -buildfile unix.xml"

The ftp access is able to perform sucessfully (on the same port 22)


with regards
Karthik


  -----Original Message-----
  From: Jeffrey E Care [mailto:carej@us.ibm.com]
  Sent: Monday, February 20, 2006 7:26 PM
  To: Ant Users List
  Subject: Re: Ant ,ftp,java



  Double check your port numbers.

____________________________________________________________________________
________________
        Jeffrey E. (Jeff) Care  carej@us.ibm.com
        IBM WebSphere Application Server Development  WAS Pyxis Lead Release
Engineer




  "Karthik" <ka...@xius.org> wrote on 02/20/2006 02:31:54 AM:

  > Hi form
  >
  > On  running the ftp target (in build.xml ) from  java using  "org.
  > apache.tools.ant.*" I ageeint this Exception as below.
  >
  >
============================================================================
================
  > <target name="TgtName">
  >
  >    <fileset dir="${libs}">
  >     <include name="**/*.jar"/>
  >   </fileset>
  >
  >   <ftp server="${ftptype}"
  >        remotedir = "${ftpremotedir}"
  >     userid = "${ftpid}"
  >        password = "${ftppas}"
  >           Port= "22"
  >        action="put"
  >     separator="/"
  >   >
  >     <fileset dir="${src.dir}">
  >              <include name="*.txt" />
  >
  >           </fileset>
  >      </ftp>
  >   </target>
  >
  > error:
  > --------
  >
  > D:\TEST\unix.xml:38: error during FTP transfer: org.apache.commons.
  > net.MalformedServerReplyException: Could not parse response code.
  > Server Reply: SSH-1.99-OpenSSH_3.6.1p2
  >  at
org.apache.tools.ant.taskdefs.optional.net.FTP.execute(FTP.java:2014)
  >  at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
  >  at org.apache.tools.ant.Task.perform(Task.java:364)
  >  at org.apache.tools.ant.Target.execute(Target.java:341)
  >  at org.apache.tools.ant.Target.performTasks(Target.java:369)
  >  at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
  >  at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
  >  at com.xius.copy.os.xnix.FILECOPY1_1.runTarget(FILECOPY1_1.java:43)
  >  at com.xius.copy.os.xnix.FILECOPY1_1.main(FILECOPY1_1.java:62)
  >
  >
============================================================================
================
  >
  >
  > but if I run the same FTP tag  from  ant ( ant -buildfile build.xml
  > ),then  the task is  processeed sucessfully.
  >
  >
  >
  > Note : in both cases I have made shure to set classpath of
  >
  > commons-net-1.4.1.jar
  > jakarta-oro-2.0.8.jar
  >
  >
  >
  > Some body Please tell me why am i getting the error...
  >
  > with regards
  > Karthik

Re: Ant ,ftp,java

Posted by Jeffrey E Care <ca...@us.ibm.com>.
Double check your port numbers.

____________________________________________________________________________________________ 

Jeffrey E. (Jeff) Care 
carej@us.ibm.com 
IBM WebSphere Application Server Development 
WAS Pyxis Lead Release Engineer 




"Karthik" <ka...@xius.org> wrote on 02/20/2006 02:31:54 AM:

> Hi form
> 
> On  running the ftp target (in build.xml ) from  java using  "org.
> apache.tools.ant.*" I ageeint this Exception as below.
> 
> 
============================================================================================
> <target name="TgtName">
> 
>    <fileset dir="${libs}">
>     <include name="**/*.jar"/>
>   </fileset> 
> 
>   <ftp server="${ftptype}"
>        remotedir = "${ftpremotedir}"
>     userid = "${ftpid}"
>        password = "${ftppas}" 
>           Port= "22"
>        action="put"
>     separator="/" 
>   >
>     <fileset dir="${src.dir}">
>              <include name="*.txt" />
> 
>           </fileset> 
>      </ftp>
>   </target>
> 
> error:
> --------
> 
> D:\TEST\unix.xml:38: error during FTP transfer: org.apache.commons.
> net.MalformedServerReplyException: Could not parse response code.
> Server Reply: SSH-1.99-OpenSSH_3.6.1p2
>  at 
org.apache.tools.ant.taskdefs.optional.net.FTP.execute(FTP.java:2014)
>  at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
>  at org.apache.tools.ant.Task.perform(Task.java:364)
>  at org.apache.tools.ant.Target.execute(Target.java:341)
>  at org.apache.tools.ant.Target.performTasks(Target.java:369)
>  at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
>  at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
>  at com.xius.copy.os.xnix.FILECOPY1_1.runTarget(FILECOPY1_1.java:43)
>  at com.xius.copy.os.xnix.FILECOPY1_1.main(FILECOPY1_1.java:62)
> 
> 
============================================================================================
> 
> 
> but if I run the same FTP tag  from  ant ( ant -buildfile build.xml 
> ),then  the task is  processeed sucessfully.
> 
> 
> 
> Note : in both cases I have made shure to set classpath of 
> 
> commons-net-1.4.1.jar
> jakarta-oro-2.0.8.jar
> 
> 
> 
> Some body Please tell me why am i getting the error...
> 
> with regards
> Karthik