Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
6.2k views
in Java FTP by (120 points)
Hi!

I'm running the sample program to get a directory listing with the free java FTP client. I'm running on 64-bit Windows 7 with JDK1.6.0_17. Connection and login works but then it hangs on reading the directory contents. No problem with accessing the
ftp site using a browser as well as using python. Any help is highly appreciated.

D.

=============================
C:\edtftpj-2.0.5\examples\howto\get_a_directory_listing>run blah.com username password
INFO [GetDirectoryListing] 23 Dec 2009 10:00:27.398 : Creating FTP client
INFO [GetDirectoryListing] 23 Dec 2009 10:00:27.420 : Setting remote host
INFO [GetDirectoryListing] 23 Dec 2009 10:00:27.421 : Connecting to server blah.com
INFO [GetDirectoryListing] 23 Dec 2009 10:00:28.832 : Connected and logged in to server blah.com
INFO [GetDirectoryListing] 23 Dec 2009 10:00:28.832 : Getting current directory listing
ERROR [FTPControlSocket] 23 Dec 2009 10:02:29.781 : Read failed ('' read so far)
WARN [FTPClient] 23 Dec 2009 10:02:29.781 : Validate transfer on error failed : Read timed out
com.enterprisedt.net.ftp.ControlChannelIOException: Read timed out
at com.enterprisedt.net.ftp.FTPControlSocket.readLine(FTPControlSocket.java:1014)
at com.enterprisedt.net.ftp.FTPControlSocket.readReply(FTPControlSocket.java:1049)
at com.enterprisedt.net.ftp.FTPClient.validateTransfer(FTPClient.java:2460)
at com.enterprisedt.net.ftp.FTPClient.validateTransferOnError(FTPClient.java:2488)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:3506)
at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:3424)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:638)
at GetDirectoryListing.main(GetDirectoryListing.java:52)


com.enterprisedt.net.ftp.ControlChannelIOException: Read timed out
at com.enterprisedt.net.ftp.FTPControlSocket.readLine(FTPControlSocket.java:1014)
at com.enterprisedt.net.ftp.FTPControlSocket.readReply(FTPControlSocket.java:1049)
at com.enterprisedt.net.ftp.FTPClient.validateTransfer(FTPClient.java:2460)
at com.enterprisedt.net.ftp.FTPClient.validateTransferOnError(FTPClient.java:2488)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:3506)
at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:3424)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:638)
at GetDirectoryListing.main(GetDirectoryListing.java:52)
java.net.SocketTimeoutException: Accept timed out
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:390)
at java.net.ServerSocket.implAccept(ServerSocket.java:453)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.acceptConnection(FTPActiveDataSocket.java:185)
at com.enterprisedt.net.ftp.internal.FTPActiveDataSocket.getInputStream(FTPActiveDataSocket.java:212)
at com.enterprisedt.net.ftp.FTPClient.getInputStream(FTPClient.java:3091)
at com.enterprisedt.net.ftp.FTPClient.dir(FTPClient.java:3495)
at com.enterprisedt.net.ftp.FTPClient.dirDetails(FTPClient.java:3424)
at com.enterprisedt.net.ftp.FileTransferClient.directoryList(FileTransferClient.java:638)
at GetDirectoryListing.main(GetDirectoryListing.java:52)

1 Answer

0 votes
by (162k points)
Sorry, this post slipped past us. The most likely reason is a firewall is blocking the connection. Switch from passive to active mode or vice versa, that might help.

Categories

...