commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Duval <rdg.du...@ibest.com.br>
Subject Commons-net FTP and AIX 5.3 FTP Server
Date Fri, 23 Apr 2010 14:55:49 GMT
Hello,

Let me explain what's happening: I have no problems connecting and uploading
files to Linux, Windows or even SCO (yes, it still exists) FTP servers, but
when I try to execute a simple command using FTPClient to AIX 5.3 I got the
following exception:

   1.
   org.apache.commons.net.MalformedServerReplyException: Could not
parse response code.
   2. Server Reply: : The socket name is not available on this system.
   3.     at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:316)
   4.     at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:491)
   5.     at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:533)
   6.     at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:582)
   7.     at org.apache.commons.net.ftp.FTP.quit(FTP.java:790)
   8.     at org.apache.commons.net.ftp.FTPClient.logout(FTPClient.java:759
   )
   9.
       at testes.integracao.FtpCommonsNetTest.testRiscf80(FtpCommonsNetTest.java:
   27)
   10.         ...

org.apache.commons.net.MalformedServerReplyException: Could not parse
response code. Server Reply: : The socket name is not available on this
system. at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:316) at
org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:491) at
org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:533) at
org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:582) at
org.apache.commons.net.ftp.FTP.quit(FTP.java:790) at
org.apache.commons.net.ftp.FTPClient.logout(FTPClient.java:759) at
testes.integracao.FtpCommonsNetTest.testRiscf80(FtpCommonsNetTest.java:27)
... The code that generates the stack above is just that:

   1.     @Test
   2.     public final void testRiscf80() throws Exception {
   3.         FTPClient ftp = new FTPClient();
   4.         try {
   5.             ftp.connect(AIX_HOST_IP);
   6.             ftp.login(AIX_USER, AIX_PASSWD);
   7.             ftp.changeWorkingDirectory(
   "/riscf80/path/to/uploaded/files");
   8.             File file = new File("some-dummy-file.gz");
   9.             FileInputStream fis = new FileInputStream(file);
   10.             ftp.storeFile(fileName, fis);
   // Line where exception occurs
   11.         } finally {
   12.             ftp.logout();
   13.             ftp.disconnect();
   14.         }
   15.     }

@Test public final void testRiscf80() throws Exception { FTPClient ftp = new
FTPClient(); try { ftp.connect(AIX_HOST_IP); ftp.login(AIX_USER,
AIX_PASSWD); ftp.changeWorkingDirectory("/riscf80/path/to/uploaded/files");
File file = new File("some-dummy-file.gz"); FileInputStream fis = new
FileInputStream(file); ftp.storeFile(fileName, fis); // Line where exception
occurs } finally { ftp.logout(); ftp.disconnect(); } } That was intriguing,
so I performed some research and reached the following results printing all
responses from the server while was just trying to list some folder files:

   1.     @Test
   2.     public void testListingRiscf80Internal() throws Exception {
   3.         FTPClient client = new FTPClient();
   4.         try {
   5.             client.connect(AIX_HOST_IP);
   6.             System.out.println(client.getReplyString());
   7.             if(client.login(AIX_USER, AIX_PASSWD)) {
   8.                 System.out.println(client.getReplyString());
   9.                 client.setFileType(FTPClient.BINARY_FILE_TYPE);
   10.                 System.out.println(client.getReplyString());
   11.                 client.pwd();
   12.                 System.out.println(client.getReplyString());
   13.                 client.list(); // This generates the 425 reply code
   14.                 System.out.println(client.getReplyString());
   15.             }
   16.         } finally {
   17.             client.logout(); // Where exception is thrown
   18.             client.disconnect();
   19.         }

@Test public void testListingRiscf80Internal() throws Exception { FTPClient
client = new FTPClient(); try { client.connect(AIX_HOST_IP);
System.out.println(client.getReplyString()); if(client.login(AIX_USER,
AIX_PASSWD)) { System.out.println(client.getReplyString());
client.setFileType(FTPClient.BINARY_FILE_TYPE);
System.out.println(client.getReplyString()); int pwd = client.pwd();
System.out.println(pwd+" / "+client.getReplyString()); int list =
client.list(); // This generates the 425 reply code
System.out.println(list+" / "+client.getReplyString()); } } finally {
client.logout(); // Where exception is thrown client.disconnect(); }
And these are the sysout results:

220 riscf80 FTP server (Version 4.2 Fri May 2 12:48:10 CDT 2008) ready.
230-Last unsuccessful login: Wed Apr 21 18:35:18 GRNLNDST 2010 on ssh from
SOME_IP
230-Last login: Thu Apr 22 19:41:45 GRNLNDST 2010 on ftp from SOME_HOST
230 User SOME_USER logged in.
200 Type set to I.
257 "/riscf80/some/folder" is current directory.
425      No data connection
220 riscf80 FTP server (Version 4.2 Fri May 2 12:48:10 CDT 2008) ready.
230-Last unsuccessful login: Wed Apr 21 18:35:18 GRNLNDST 2010 on ssh from
SOME_IP 230-Last login: Thu Apr 22 19:41:45 GRNLNDST 2010 on ftp from
SOME_HOST 230 User SOME_USER logged in. 200 Type set to I. 257 / 257
"/riscf80/some/folder" is current directory. 425 / 425 No data connection
Some additional data may be useful to understand this issue:
There is no firewall between the client and the FTPServer
I've tried other client libraries (like edtFTPJ, ftp4j), they work but their
performance is very poor compared to commons-net
I couldn't find an explicit way to set preference on ipv4 stack over ipv6
stack in commons-net lib
I've also tried to enable the remote passive mode for no avail. Tried
several different things, like disabling the remote verification, and
nothing made the trick. It's a very specific problem, but any thoughts would
be greatly appreciated.

Thanks in advance

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message