commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaw shaw <shaw...@yahoo.com>
Subject Re: Time out when using FTPClient.storeFile
Date Tue, 26 Feb 2008 15:37:30 GMT
Daniel,
   
  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.
   
  Thanks,
  Shawn

"Daniel F. Savarese" <dfs@savarese.org> wrote:
  
In message <497775.86021.qm@web50304.mail.re2.yahoo.com>, 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
>d 

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?

daniel



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org



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