Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 85285 invoked from network); 23 Apr 2010 20:29:18 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Apr 2010 20:29:18 -0000 Received: (qmail 8515 invoked by uid 500); 23 Apr 2010 20:29:17 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 8428 invoked by uid 500); 23 Apr 2010 20:29:17 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 8420 invoked by uid 99); 23 Apr 2010 20:29:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Apr 2010 20:29:17 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [74.208.4.195] (HELO mout.perfora.net) (74.208.4.195) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Apr 2010 20:29:10 +0000 Received: from steve (rrcs-96-10-246-41.midsouth.biz.rr.com [96.10.246.41]) by mrelay.perfora.net (node=mrus2) with ESMTP (Nemesis) id 0MN1SC-1O3Egv0O76-006bf5; Fri, 23 Apr 2010 16:28:46 -0400 From: "Steve Cole" To: "'Commons Users List'" References: In-Reply-To: Subject: RE: Commons-net FTP and AIX 5.3 FTP Server Date: Fri, 23 Apr 2010 16:28:43 -0400 Message-ID: <5D87198C339B47EBA8963892F7E1476C@cbs> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 11 thread-index: AcrjG6xuc3kziGmbRTy/MH0VudEGTQABxL3w X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7600.16385 X-Provags-ID: V01U2FsdGVkX1/Op7pQprI3XpkwmfBhIjyTr2cySmwdaPMtJIJ qCwvzZK1TDXfngOXmkXqCjDn0xlve+RtbCCVoZ3+wbYiVuaoEm QKRpjEZ/TDEToLw6CQZHiNA3Q7FWQqv X-Virus-Checked: Checked by ClamAV on apache.org You said you already tried changing active/passive mode. Did you set = after login, just before the list() method? if (passiveMode){ ftpClient.enterLocalPassiveMode(); }else{ ftpClient.enterLocalActiveMode(); } ftpClient.list(); -----Original Message----- From: Ricardo Duval [mailto:rdg.duval@ibest.com.br]=20 Sent: Friday, April 23, 2010 3:32 PM To: Commons Users List Subject: Re: Commons-net FTP and AIX 5.3 FTP Server Steve, I had already tried setting this parameter manually (on System class). = Just to be sure, now follow the results passing it on command line execution (Maven test): C:\devel\workspace-nfe\ftp-proof>mvn -Dtest=3DFtpCommonsNetTest -Djava.net.preferIPv4Stack=3Dtrue test ... Results : Tests in error: testRiscf80(testes.integracao.FtpCommonsNetTest) Tests run: 3, Failures: 0, Errors: 1, Skipped: 2 ... And these are the individual test results: Tests run: 3, Failures: 0, Errors: 1, Skipped: 2, Time elapsed: 0.25 sec = <<< FAILURE! testRiscf80(tests.integrated.FtpCommonsNetTest) Time elapsed: 0.156 sec <<< ERROR! 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) ... Based on this test: @Test public final void testRiscf80() throws Exception { FTPClient ftp =3D new FTPClient(); FileInputStream fis =3D null; try { ftp.connect(SOME_AIX_HOST); ftp.login(SOME_USER, SOME_PASS); ftp.changeWorkingDirectory("/riscf80/some/remote/path"); File file =3D new File(PATH, FILE_NAME); fis =3D new FileInputStream(file); ftp.storeFile(fileName, fis); } finally { ftp.logout(); ftp.disconnect(); if(fis !=3D null) { fis.close(); } } } I double checked to see if the preferIPv4Stack was there on the = execution properties, and I also tried passing java.net.preferIPv6Stack=3Dfalse, = but for no avail. Thanks 2010/4/23 Steve Cole > The exception is occurring when a QUIT command is sent, simply because = it > failed to parse the server reply. The actual problem appears to be a > connection issue. It can't open the data connection. That's why list() > failed. Have you tried setting the property = java.net.preferIPv4Stack=3Dtrue? > > > -----Original Message----- > From: Ricardo Duval [mailto:rdg.duval@ibest.com.br] > Sent: Friday, April 23, 2010 1:46 PM > To: Commons Users List > Subject: Re: Commons-net FTP and AIX 5.3 FTP Server > > Martin, > > Unfortunately I already tried with ASCII type. The first example I = sent I > didn't change the default FTP transfer type which is ASCII. > > Using some other cliente I can easily upload files, even using other = FTP > client libs like edtFTPj. The same set of commands using the MS FTP = client > (DOS) gave the following result: > > C:\Documents and Settings\rduval.FCD>ftp SOME_IP > Connected to SOME_IP. > 220 riscf80 FTP server (Version 4.2 Fri May 2 12:48:10 CDT 2008) = ready. > User (SOME_IP:(none)): SOME_USER > 331 Password required for SOME_USER. > Password: > 230-Last unsuccessful login: Fri Apr 23 13:55:51 GRNLNDST 2010 on ftp = from > SOME_HOME > 230-Last login: Fri Apr 23 14:22:06 GRNLNDST 2010 on ftp from = SOME_HOME > 230 User SOME_USER logged in. > ftp> binary > 200 Type set to I. > ftp> pwd > 257 "/riscf80/some/folder" is current directory. > ftp> cd ../nfe > 250 CWD command successful. > ftp> pwd > 257 "/riscf80/some/nfe" is current directory. > ftp> ls > 200 PORT command successful. > 150 Opening data connection for .. > lost+found > 61438248003904006 > 61438248004625033 > ... (Several files and folders) > 61438248005605033 > 226 Transfer complete. > ftp: 639 bytes received in 0,05Seconds 13,60Kbytes/s. > ftp> quit > 221 Goodbye. > > I think the problem is something in the lib itself, but I tried to = debug it > and couldn't find a reason for that. > > R. Duval > > 2010/4/23 Martin Gainty > > > > > one possible problem is > > type i (if your sending/receiving machine is EBCDIC and > > the file contains non-display data, e.g., COMP-3); > > i know of one system that sends/receives EBCDIC.. an old ibm = mainframe > that > > the army abandoned in Saigon in 75..all other computer systems > send/receive > > and process in ascii > > > > i would strongly suggest setting type=3D'a' > > http://www.ucop.edu/irc/campus_specs/ftp/aixftp.html > > > > what happens when you use issue the same series of commands at > command-line > > prompt? > > Martin Gainty > > ______________________________________________ > > Verzicht und Vertraulichkeitanmerkung/Note de d=E9ni et de = confidentialit=E9 > > > > > Date: Fri, 23 Apr 2010 11:55:49 -0300 > > > Subject: Commons-net FTP and AIX 5.3 FTP Server > > > From: rdg.duval@ibest.com.br > > > To: user@commons.apache.org > > > > > > 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. ... > > > > > > ... The code that generates the stack above is just that: > > > > > > 1. @Test > > > 2. public final void testRiscf80() throws Exception { > > > 3. FTPClient ftp =3D 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 =3D new File("some-dummy-file.gz"); > > > 9. FileInputStream fis =3D new = FileInputStream(file); > > > 10. ftp.storeFile(fileName, fis); > > > // Line where exception occurs > > > 11. } finally { > > > 12. ftp.logout(); > > > 13. ftp.disconnect(); > > > 14. } > > > 15. } > > > > > > 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 =3D 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. } > > > > > > 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 > > > > > > 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 > > > > > > > --------------------------------------------------------------------- > 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