Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 88876 invoked from network); 3 Sep 2005 13:34:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Sep 2005 13:34:40 -0000 Received: (qmail 94811 invoked by uid 500); 3 Sep 2005 13:34:36 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 94797 invoked by uid 500); 3 Sep 2005 13:34:35 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 94784 invoked by uid 99); 3 Sep 2005 13:34:35 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Sep 2005 06:34:35 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [196.7.147.2] (HELO www2a.your-server.co.za) (196.7.147.2) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Sep 2005 06:34:49 -0700 Received: from [165.165.224.71] (helo=[169.254.255.20]) by www2a.your-server.co.za with esmtp (Exim 4.51) id 1EBYA7-00078G-OV for commons-user@jakarta.apache.org; Sat, 03 Sep 2005 15:34:31 +0200 From: Stefan Viljoen Reply-To: sviljoen@polard.com Organization: Polar Design Solutions To: commons-user@jakarta.apache.org Subject: [NET] problem with FTP module Linux / XP narrowed down Date: Sat, 3 Sep 2005 15:35:54 +0000 User-Agent: KMail/1.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509031535.54789.sviljoen@polard.com> X-Virus-Scanned: Clear (ClamAV 0.86.2/1059/Sat Sep 3 09:31:58 2005) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N As regards the apparent issue with wrong behaviour of the storeFile method on XP machines only: I have done further testing on this and I have discovered that storeFile attempts to connect to the webserver the applet is running on, when called on XP machines with the Windows JVM, NOT the logged in FTP server as is logged in to when that instance of the FTPClient object that is having its storeFile method being called is started to be used. On all XP machines, this is displayed in the Java console. Lines tagged J are JVM output, lines tagged P is output System.out.prinln'ed by my program: J1: network: Connecting socket://polard.com:21 with proxy=DIRECT J2: network: Connecting socket://polard.com:21 with proxy=DIRECT P1: Connected for initial upload! P2: Passive mode set P2: Transferring... P2: Starting upload now... *J3: network: Connecting socket://www2a.your-server.co.za:50989 with proxy=DIRECT Upload failed - storeFile returned false - socket? The line marked with the asterisk is the error line. Line J3 should be: network: Connecting socket://polard.com:20 with proxy=DIRECT to initate a data port connection (FTP on port 20) with the polard.com server, to start transferring the file, from that Windows XP machine. This is NOT what happens - why does it connect to my webserver, network: Connecting socket://www2a.your-server.co.za:50989 with proxy=DIRECT instead of polard.com:20, to which the object is "logged in" using its connect method? With a random port number? The :50989 changes from run to run. On the Linux JVM, it looks and works exactly right, exactly the same sourceode: J1: network: Connecting socket://polard.com:21 with proxy=DIRECT J2: network: Connecting socket://polard.com:21 with proxy=DIRECT P1: Connected for initial upload! P2: Passive mode set P2: Transferring... P2: Starting upload now... *J3: network: Connecting socket://polard.com:20 with proxy=DIRECT So the apparent bug is that on Windows JVMs the commons.net FTP module "forgets" the server it is connected to, trying instead to open a socket to the remote host the applet is running on, with a random port number, instead of the FTP server connected to and logged in to with that FTPClient object's instances of connect() and login(). How can this be resolved? Is it a bug at all? -- Stefan Viljoen Software Support Technician / Programmer Polar Design Solutions Mobile: (+27) 83 4060854 Tel: (+27) 18 297 1753 Fax: (+27) 18 290 5556 http://polard.com --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org