commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rohit mungee <rohit...@yahoo.com>
Subject MalformedServerReplyException: Server Reply: 27 Entering Passive Mode
Date Fri, 06 Jul 2007 21:53:14 GMT

Hi All,
I am using Commons Net 1.4.0 and seeing this problem with a particular FTP
server. I am connecting to the FTP server using the commons net API and
frequently get the MalformedServerReplyException. On looking at the commons
net FTP.java source file, I see that it is caused because we were unable to
parse the server reply "27 Entering Passive Mode". The expected response
code is "227 Entering Passive Mode". The code:
try
        {
            String code = line.substring(0, 3);
            _replyCode = Integer.parseInt(code);
        }
        catch (NumberFormatException e)
        {
            throw new MalformedServerReplyException(
                "Could not parse response code.\nServer Reply: " + line);
        }

Clearly, substring 0,3 will yeild "27 " which is probably causing the
exception. I telnetted to the offending server on the FTP port but was not
able to get the "27" instead of "227" error code. Anyone seen this problem ?
Is this a problem with the commons net library or am I doing something wrong
? Thanks,

Rohit

The FTP server administrator is not able to reproduce the issue and a m
-- 
View this message in context: http://www.nabble.com/MalformedServerReplyException%3A-Server-Reply%3A-27-Entering-Passive-Mode-tf4038305.html#a11473041
Sent from the Commons - User mailing list archive at Nabble.com.


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


Mime
View raw message