Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 78600 invoked from network); 5 Mar 2011 00:55:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Mar 2011 00:55:08 -0000 Received: (qmail 97860 invoked by uid 500); 5 Mar 2011 00:55:08 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 97782 invoked by uid 500); 5 Mar 2011 00:55:08 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 97735 invoked by uid 99); 5 Mar 2011 00:55:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Mar 2011 00:55:08 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Mar 2011 00:55:07 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 4FBDF55F84 for ; Sat, 5 Mar 2011 00:54:46 +0000 (UTC) Date: Sat, 5 Mar 2011 00:54:46 +0000 (UTC) From: "Sebb (JIRA)" To: issues@commons.apache.org Message-ID: <1289128858.440.1299286486323.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Resolved: (NET-296) java.net.SocketException: Operation timed out error while entering Passive mode MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/NET-296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sebb resolved NET-296. ---------------------- Resolution: Duplicate I see you have opened NET-363, so closing this as a duplicate > java.net.SocketException: Operation timed out error while entering Passive mode > ------------------------------------------------------------------------------- > > Key: NET-296 > URL: https://issues.apache.org/jira/browse/NET-296 > Project: Commons Net > Issue Type: Bug > Affects Versions: 2.0 > Environment: Windows XP, JDK 1.5.0_15, commons-net-2.0-jdk14.jar > Reporter: Hariprasad K S > Priority: Blocker > > Hi, > I am getting the following error while trying to connect to the FTP (Explicit). > java.net.SocketException: Operation timed out: connect:could be due to invalid address. > I am facing this error when i am running the code from the client machine which is in different domain...If i run the same code in the domain where ftp exists..it works fine without any issue...below is my code and the trace log....Pls help. > FTPSClient client = new FTPSClient("TLS",false); > client.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out))); > boolean _ftp_login = false; > > try { > String[] hname = ftpurl.split("//"); > client.setAuthValue("TLS"); > client.setRemoteVerificationEnabled(false); > client.connect("ftp.kotaklifeinsurance.com",22); > > int reply = client.getReplyCode(); > client.execPBSZ(0); > client.execPROT("P"); > > if (!FTPReply.isPositiveCompletion(reply)) { > client.disconnect(); > System.out.println("openFTPClient(): FTP server refused connection."); > throw new Exception("FTP server refused connection."); > } else { > try { > _ftp_login = client.login(userID, password); > } catch (Exception e) { > throw e; > } > if (_ftp_login) { > > client.enterLocalPassiveMode(); > > if (client.printWorkingDirectory() == null) > throw new Exception("Current working directory returned is null"); > client.changeWorkingDirectory("/XYZ/"); > fis = new FileInputStream(localfile); > ins = (InputStream)fis; > boolean flag = client.storeFile(filename,ins); > System.out.println("File saved to FTP : "+flag); > Error Trace : > 220 Unauthorized Access Prohibited. > AUTH TLS > 234 AUTH command ok. Expecting TLS Negotiation. > PBSZ 0 > 200 PBSZ command successful. > PROT P > 200 PROT command successful. > USER userid > 331 Password required for userid. > PASS password > 230 User logged in. > PWD > 257 "/" is current directory. > CWD /XYZ/ > 250 CWD command successful. > PWD > 257 "/XYZ" is current directory. > TYPE A > 200 Type set to A. > MODE I > 501 'MODE I': parameter not understood. > STRU F > 200 STRU F ok. > PASV > 227 Entering Passive Mode (192,168,201,220,195,108). > java.net.SocketException: Operation timed out: connect:could be due to invalid address > at java.net.PlainSocketImpl.socketConnect(Native Method) > at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:331) > at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:196) > at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:183) > at java.net.Socket.connect(Socket.java:478) > at java.net.Socket.connect(Socket.java:428) > at java.net.Socket.(Socket.java:335) > at java.net.Socket.(Socket.java:150) > at com.ibm.jsse.bs.(Unknown Source) > at com.ibm.jsse.JSSESocketFactory.createSocket(Unknown Source) > at org.apache.commons.net.ftp.FTPSSocketFactory.createSocket(FTPSSocketFactory.java:48) > at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:502) > at org.apache.commons.net.ftp.FTPSClient._openDataConnection_(FTPSClient.java:494) > at org.apache.commons.net.ftp.FTPClient.__storeFile(FTPClient.java:374) > at org.apache.commons.net.ftp.FTPClient.storeFile(FTPClient.java:1379) -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira