commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaw shaw <>
Subject Re: Time out when using FTPClient.storeFile
Date Tue, 26 Feb 2008 15:37:30 GMT
  I finallay found the solution. I just removed the enterLocalPassiveMode(), then it works.
 I think the FTP Server supports the passive mode because I manaully FTP by using passive
mode without any problem.  Not sure why it does not like the local passive mode in the code.

"Daniel F. Savarese" <> wrote:
In message <>, shaw shaw writes:
> Thank you for your help. I tried to use setDataTimeout and still got time o
>ut. I changed the timeout value for both FTPClient.setDataTimeout(timeout) an

Sorry, it didn't completely register with me that this was a connection
timeout. The right way to do set the connection timeout until Commons Net
abandons older JVM compatibility is by creating a custom SocketFactory
that uses a connection timeout when creating the socket. The data
connection in Commons Net 1.4.x uses the socket factory to create
the socket for the data connection. Is it possible that the remote
server does not support passive mode?

Without seeing the code to your socket factory, my guess is the problem
is not with Commons Net. Your stack trace produces a ConnectException
from Socket.connect from inside of your MySocketFactory.createSocket
method. So that indicates that the connection attempt is being made
and any failure is outside of the scope of FTPClient, which hands
off the connection responsibility to MySocketFactory.createSocket from
within FTPClient._openDataConnection_. Maybe print out the arguments
that are passed to MySocketFactory.createSocket and make sure they
are correct. Is it possible the wrong address is being given?


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

Looking for last minute shopping deals?  Find them fast with Yahoo! Search.
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message