commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rohit mungee <>
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 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:
            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,


The FTP server administrator is not able to reproduce the issue and a m
View this message in context:
Sent from the Commons - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message