You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Emerson Castañeda <em...@gmail.com> on 2016/04/02 00:17:21 UTC
[net] Getting MalformedServerReplyException in FTPClientExample Class
Hello
I'm using FTPClientExample
<https://commons.apache.org/proper/commons-net/examples/ftp/FTPClientExample.java>class
with these parameters:
java FTPClientExample -l -p SFTP 192.158.76.218:22 user pwd
I'm getting this exception:
Could not connect to server.
org.apache.commons.net.MalformedServerReplyException: Could not parse
response code.
Server Reply: SSH-2.0-OpenSSH_5.3
at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:336)
at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:292)
at org.apache.commons.net.ftp.FTP._connectAction_(FTP.java:418)
at
org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:966)
at
org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:954)
at
org.apache.commons.net.ftp.FTPSClient._connectAction_(FTPSClient.java:222)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:189)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:209)
at lib_ftputility.FTPClientExample.main(FTPClientExample.java:311)
Thanks in advance for your support
Emerson
RE: [net] Getting MalformedServerReplyException in FTPClientExample Class
Posted by Emerson Castañeda <em...@gmail.com>.
Martin, Any implications because that harcoding?
Thanks
Emerson
On Apr 2, 2016 1:51 AM, "Martin Gainty" <mg...@hotmail.com> wrote:
> ALL of these files have Locale.ENGLISH hardcoded:
>
> commons-net\src\main\java\org\apache\commons\net\ftp\FTPClient.javacommons-net\src\main\java\org\apache\commons\net\ftp\FTPClientConfig.javacommons-net\src\main\java\org\apache\commons\net\ftp\parser\DefaultFTPFileEntryParserFactory.javacommons-net\src\main\java\org\apache\commons\net\ftp\parser\MLSxEntryParser.javacommons-net\src\main\java\org\apache\commons\net\tftp\TFTPRequestPacket.javacommons-net\src\test\java\org\apache\commons\net\ftp\FTPClientConfigTest.javacommons-net\src\test\java\org\apache\commons\net\ftp\parser\FTPTimestampParserImplTest.java
> Martín
> ______________________________________________
>
>
>
> > Date: Sat, 2 Apr 2016 00:33:38 +0100
> > Subject: Re: [net] Getting MalformedServerReplyException in
> FTPClientExample Class
> > From: sebbaz@gmail.com
> > To: user@commons.apache.org
> >
> > On 1 April 2016 at 23:17, Emerson Castañeda <em...@gmail.com> wrote:
> > > Hello
> > >
> > > I'm using FTPClientExample
> > > <
> https://commons.apache.org/proper/commons-net/examples/ftp/FTPClientExample.java
> >class
> > > with these parameters:
> >
> > Which version?
> >
> > >
> > > java FTPClientExample -l -p SFTP 192.158.76.218:22 user pwd
> > >
> > >
> > > I'm getting this exception:
> > >
> > > Could not connect to server.
> > > org.apache.commons.net.MalformedServerReplyException: Could not parse
> > > response code.
> > > Server Reply: SSH-2.0-OpenSSH_5.3
> > > at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:336)
> > > at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:292)
> > > at org.apache.commons.net.ftp.FTP._connectAction_(FTP.java:418)
> > > at
> > >
> org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:966)
> > > at
> > >
> org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:954)
> > > at
> > >
> org.apache.commons.net.ftp.FTPSClient._connectAction_(FTPSClient.java:222)
> > > at
> org.apache.commons.net.SocketClient.connect(SocketClient.java:189)
> > > at
> org.apache.commons.net.SocketClient.connect(SocketClient.java:209)
> > > at lib_ftputility.FTPClientExample.main(FTPClientExample.java:311)
> >
> > There should be some more output before the exception.
> >
> > >
> > > Thanks in advance for your support
> > >
> > >
> > > Emerson
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> >
>
RE: [net] Getting MalformedServerReplyException in FTPClientExample
Class
Posted by Martin Gainty <mg...@hotmail.com>.
i tried to login to my FTP server with english username/password
english authenticates with username,password and ftp opens valid connection:
.\target\test-classes>java -classpath C:\Maven-plugin\commons-net\target\classes;.;%CLASSPATH% examples.ftp.FTPClientExample -l 12.123.12.12 ****n** **********n
i tried to login to my FTP server with espanol Nombre de Usuario/Contrasuena:
espanol autenticación falta con 530:
.\target\test-classes>java -classpath C:\Maven-plugin\commons-net\target\classes;.;%CLASSPATH% examples.ftp.FTPClientExample -l 12.123.12.12 ****ñ** **********ñ
?
Martín
______________________________________________
> From: mgainty@hotmail.com
> To: user@commons.apache.org
> Subject: RE: [net] Getting MalformedServerReplyException in FTPClientExample Class
> Date: Fri, 1 Apr 2016 19:51:38 -0400
>
> ALL of these files have Locale.ENGLISH hardcoded:
> commons-net\src\main\java\org\apache\commons\net\ftp\FTPClient.javacommons-net\src\main\java\org\apache\commons\net\ftp\FTPClientConfig.javacommons-net\src\main\java\org\apache\commons\net\ftp\parser\DefaultFTPFileEntryParserFactory.javacommons-net\src\main\java\org\apache\commons\net\ftp\parser\MLSxEntryParser.javacommons-net\src\main\java\org\apache\commons\net\tftp\TFTPRequestPacket.javacommons-net\src\test\java\org\apache\commons\net\ftp\FTPClientConfigTest.javacommons-net\src\test\java\org\apache\commons\net\ftp\parser\FTPTimestampParserImplTest.java
> Martín
> ______________________________________________
>
>
>
> > Date: Sat, 2 Apr 2016 00:33:38 +0100
> > Subject: Re: [net] Getting MalformedServerReplyException in FTPClientExample Class
> > From: sebbaz@gmail.com
> > To: user@commons.apache.org
> >
> > On 1 April 2016 at 23:17, Emerson Castañeda <em...@gmail.com> wrote:
> > > Hello
> > >
> > > I'm using FTPClientExample
> > > <https://commons.apache.org/proper/commons-net/examples/ftp/FTPClientExample.java>class
> > > with these parameters:
> >
> > Which version?
> >
> > >
> > > java FTPClientExample -l -p SFTP 192.158.76.218:22 user pwd
> > >
> > >
> > > I'm getting this exception:
> > >
> > > Could not connect to server.
> > > org.apache.commons.net.MalformedServerReplyException: Could not parse
> > > response code.
> > > Server Reply: SSH-2.0-OpenSSH_5.3
> > > at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:336)
> > > at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:292)
> > > at org.apache.commons.net.ftp.FTP._connectAction_(FTP.java:418)
> > > at
> > > org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:966)
> > > at
> > > org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:954)
> > > at
> > > org.apache.commons.net.ftp.FTPSClient._connectAction_(FTPSClient.java:222)
> > > at org.apache.commons.net.SocketClient.connect(SocketClient.java:189)
> > > at org.apache.commons.net.SocketClient.connect(SocketClient.java:209)
> > > at lib_ftputility.FTPClientExample.main(FTPClientExample.java:311)
> >
> > There should be some more output before the exception.
> >
> > >
> > > Thanks in advance for your support
> > >
> > >
> > > Emerson
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> >
>
RE: [net] Getting MalformedServerReplyException in FTPClientExample
Class
Posted by Martin Gainty <mg...@hotmail.com>.
ALL of these files have Locale.ENGLISH hardcoded:
commons-net\src\main\java\org\apache\commons\net\ftp\FTPClient.javacommons-net\src\main\java\org\apache\commons\net\ftp\FTPClientConfig.javacommons-net\src\main\java\org\apache\commons\net\ftp\parser\DefaultFTPFileEntryParserFactory.javacommons-net\src\main\java\org\apache\commons\net\ftp\parser\MLSxEntryParser.javacommons-net\src\main\java\org\apache\commons\net\tftp\TFTPRequestPacket.javacommons-net\src\test\java\org\apache\commons\net\ftp\FTPClientConfigTest.javacommons-net\src\test\java\org\apache\commons\net\ftp\parser\FTPTimestampParserImplTest.java
Martín
______________________________________________
> Date: Sat, 2 Apr 2016 00:33:38 +0100
> Subject: Re: [net] Getting MalformedServerReplyException in FTPClientExample Class
> From: sebbaz@gmail.com
> To: user@commons.apache.org
>
> On 1 April 2016 at 23:17, Emerson Castañeda <em...@gmail.com> wrote:
> > Hello
> >
> > I'm using FTPClientExample
> > <https://commons.apache.org/proper/commons-net/examples/ftp/FTPClientExample.java>class
> > with these parameters:
>
> Which version?
>
> >
> > java FTPClientExample -l -p SFTP 192.158.76.218:22 user pwd
> >
> >
> > I'm getting this exception:
> >
> > Could not connect to server.
> > org.apache.commons.net.MalformedServerReplyException: Could not parse
> > response code.
> > Server Reply: SSH-2.0-OpenSSH_5.3
> > at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:336)
> > at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:292)
> > at org.apache.commons.net.ftp.FTP._connectAction_(FTP.java:418)
> > at
> > org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:966)
> > at
> > org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:954)
> > at
> > org.apache.commons.net.ftp.FTPSClient._connectAction_(FTPSClient.java:222)
> > at org.apache.commons.net.SocketClient.connect(SocketClient.java:189)
> > at org.apache.commons.net.SocketClient.connect(SocketClient.java:209)
> > at lib_ftputility.FTPClientExample.main(FTPClientExample.java:311)
>
> There should be some more output before the exception.
>
> >
> > Thanks in advance for your support
> >
> >
> > Emerson
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
Re: [net] Getting MalformedServerReplyException in FTPClientExample Class
Posted by sebb <se...@gmail.com>.
On 2 April 2016 at 01:04, Emerson Castañeda <em...@gmail.com> wrote:
> On Apr 2, 2016 1:33 AM, "sebb" <se...@gmail.com> wrote:
>>
>> On 1 April 2016 at 23:17, Emerson Castañeda <em...@gmail.com> wrote:
>> > Hello
>> >
>> > I'm using FTPClientExample
>> > <
> https://commons.apache.org/proper/commons-net/examples/ftp/FTPClientExample.java
>>class
>> > with these parameters:
>>
>> Which version?
>
> 3.4
>>
>> >
>> > java FTPClientExample -l -p SFTP 192.158.76.218:22 user pwd
>> >
>> >
>> > I'm getting this exception:
>> >
>> > Could not connect to server.
>> > org.apache.commons.net.MalformedServerReplyException: Could not parse
>> > response code.
>> > Server Reply: SSH-2.0-OpenSSH_5.3
>> > at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:336)
>> > at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:292)
>> > at org.apache.commons.net.ftp.FTP._connectAction_(FTP.java:418)
>> > at
>> > org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:966)
>> > at
>> > org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:954)
>> > at
>> >
> org.apache.commons.net.ftp.FTPSClient._connectAction_(FTPSClient.java:222)
>> > at
> org.apache.commons.net.SocketClient.connect(SocketClient.java:189)
>> > at
> org.apache.commons.net.SocketClient.connect(SocketClient.java:209)
>> > at lib_ftputility.FTPClientExample.main(FTPClientExample.java:311)
>>
>> There should be some more output before the exception.
>
> No more output.
Note the Server Reply:
SSH-2.0-OpenSSH_5.3
A normal server reply should be something like
220 SSH-2.0-OpenSSH_5.3
(Try a different server and see)
The server you are testing against is broken.
So the following response is the correct behaviour:
MalformedServerReplyException: Could not parse response code.
>>
>> >
>> > Thanks in advance for your support
>> >
>> >
>> > Emerson
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: [net] Getting MalformedServerReplyException in FTPClientExample Class
Posted by Emerson Castañeda <em...@gmail.com>.
On Apr 2, 2016 1:33 AM, "sebb" <se...@gmail.com> wrote:
>
> On 1 April 2016 at 23:17, Emerson Castañeda <em...@gmail.com> wrote:
> > Hello
> >
> > I'm using FTPClientExample
> > <
https://commons.apache.org/proper/commons-net/examples/ftp/FTPClientExample.java
>class
> > with these parameters:
>
> Which version?
3.4
>
> >
> > java FTPClientExample -l -p SFTP 192.158.76.218:22 user pwd
> >
> >
> > I'm getting this exception:
> >
> > Could not connect to server.
> > org.apache.commons.net.MalformedServerReplyException: Could not parse
> > response code.
> > Server Reply: SSH-2.0-OpenSSH_5.3
> > at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:336)
> > at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:292)
> > at org.apache.commons.net.ftp.FTP._connectAction_(FTP.java:418)
> > at
> > org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:966)
> > at
> > org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:954)
> > at
> >
org.apache.commons.net.ftp.FTPSClient._connectAction_(FTPSClient.java:222)
> > at
org.apache.commons.net.SocketClient.connect(SocketClient.java:189)
> > at
org.apache.commons.net.SocketClient.connect(SocketClient.java:209)
> > at lib_ftputility.FTPClientExample.main(FTPClientExample.java:311)
>
> There should be some more output before the exception.
No more output.
>
> >
> > Thanks in advance for your support
> >
> >
> > Emerson
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
Re: [net] Getting MalformedServerReplyException in FTPClientExample Class
Posted by sebb <se...@gmail.com>.
On 1 April 2016 at 23:17, Emerson Castañeda <em...@gmail.com> wrote:
> Hello
>
> I'm using FTPClientExample
> <https://commons.apache.org/proper/commons-net/examples/ftp/FTPClientExample.java>class
> with these parameters:
Which version?
>
> java FTPClientExample -l -p SFTP 192.158.76.218:22 user pwd
>
>
> I'm getting this exception:
>
> Could not connect to server.
> org.apache.commons.net.MalformedServerReplyException: Could not parse
> response code.
> Server Reply: SSH-2.0-OpenSSH_5.3
> at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:336)
> at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:292)
> at org.apache.commons.net.ftp.FTP._connectAction_(FTP.java:418)
> at
> org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:966)
> at
> org.apache.commons.net.ftp.FTPClient._connectAction_(FTPClient.java:954)
> at
> org.apache.commons.net.ftp.FTPSClient._connectAction_(FTPSClient.java:222)
> at org.apache.commons.net.SocketClient.connect(SocketClient.java:189)
> at org.apache.commons.net.SocketClient.connect(SocketClient.java:209)
> at lib_ftputility.FTPClientExample.main(FTPClientExample.java:311)
There should be some more output before the exception.
>
> Thanks in advance for your support
>
>
> Emerson
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org