Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
5.1k views
in Java FTP by (120 points)
Hello,

I'm using edtFTPj 2.0.3 to transfer files to various kinds of FTP servers.
I recently upgraded from 1.4.1 and did the switch from FTPClient to FileTransferClient.
I did this because of troubles when uploading a file blocked the whole process - the file was transfered, but the .put() never completed.
With 2.0.3 I now receive an exception for a timeout, but I have no idea if I can fix this client-side or if this is a configuration problem with the FTP servers of our customers.

EDIT : Using active mode, the behaviour is identical.


DEBUG [FTPClient] 20 Nov 2008 11:32:24.301 : Class: com.enterprisedt.net.ftp.FTPClient
Version: 2.0.3
Build timestamp: 6-Jun-2008 14:04:32 EST
Java version: 1.6.0_03
CLASSPATH: C:\java\jdk160_03\lib\tools.jar;c:\XXXXXXXXXXX\tomcat\bin\bootstrap.jar
OS name: Windows 2003
OS arch: amd64
OS version: 5.2

DEBUG [FileTransferClient] 20 Nov 2008 11:32:24.316 : Configured client
DEBUG [FTPClient] 20 Nov 2008 11:32:24.316 : Connecting to XXX.XXX.com/84.XXX.XXX.199:21
DEBUG [SocketUtils] 20 Nov 2008 11:32:24.332 : Invoking connect with timeout=60000
DEBUG [SocketUtils] 20 Nov 2008 11:32:24.332 : Connected successfully
DEBUG [FTPControlSocket] 20 Nov 2008 11:32:24.457 : 220 Microsoft FTP Service
DEBUG [FileTransferClient] 20 Nov 2008 11:32:24.457 : Client connected
DEBUG [FileTransferClient] 20 Nov 2008 11:32:24.457 : Logging in
DEBUG [FTPControlSocket] 20 Nov 2008 11:32:24.457 : ---> USER XXXXXX
DEBUG [FTPControlSocket] 20 Nov 2008 11:32:24.504 : 331 Password required for XXXXXX.
DEBUG [FTPControlSocket] 20 Nov 2008 11:32:24.519 : ---> PASS ********
DEBUG [FTPControlSocket] 20 Nov 2008 11:32:24.566 : 230 User XXXXXX logged in.
DEBUG [FileTransferClient] 20 Nov 2008 11:32:24.566 : Logged in
DEBUG [FTPControlSocket] 20 Nov 2008 11:32:24.566 : ---> TYPE I
DEBUG [FTPControlSocket] 20 Nov 2008 11:32:24.629 : 200 Type set to I.
DEBUG [FTPControlSocket] 20 Nov 2008 11:32:24.629 : ---> TYPE I
DEBUG [FTPControlSocket] 20 Nov 2008 11:32:24.691 : 200 Type set to I.
DEBUG [FTPControlSocket] 20 Nov 2008 11:32:24.691 : ---> PASV
DEBUG [FTPControlSocket] 20 Nov 2008 11:32:24.754 : 227 Entering Passive Mode (84,XXX,XXX,199,11,134).
DEBUG [FTPControlSocket] 20 Nov 2008 11:32:24.754 : Substituting server supplied IP (84.XXX.XXX.199) with remote host IP (84.XXX.XXX.199)
DEBUG [FTPControlSocket] 20 Nov 2008 11:32:24.801 : ---> STOR order_980.zip
DEBUG [FTPControlSocket] 20 Nov 2008 11:32:24.863 : 125 Data connection already open; Transfer starting.
DEBUG [FTPClient] 20 Nov 2008 11:42:25.176 : Transferred 73535658 bytes to remote host
DEBUG [FTPClient] 20 Nov 2008 11:43:25.722 : Validate transfer on error after exception : Read timed out
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at com.enterprisedt.net.ftp.FTPControlSocket.readReply(FTPControlSocket.java:910)
at com.enterprisedt.net.ftp.FTPClient.validateTransfer(FTPClient.java:2112)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2079)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2060)
at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:663)
at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:637)

java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at com.enterprisedt.net.ftp.FTPControlSocket.readReply(FTPControlSocket.java:910)
at com.enterprisedt.net.ftp.FTPClient.validateTransfer(FTPClient.java:2112)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2079)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2060)
at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:663)
at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:637)

WARN [FTPClient] 20 Nov 2008 11:43:26.222 : Validate transfer on error failed : Read timed out
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at com.enterprisedt.net.ftp.FTPControlSocket.readReply(FTPControlSocket.java:910)
at com.enterprisedt.net.ftp.FTPClient.validateTransfer(FTPClient.java:2112)
at com.enterprisedt.net.ftp.FTPClient.validateTransferOnError(FTPClient.java:2144)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2089)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2060)
at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:663)
at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:637)

java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at java.io.BufferedReader.fill(BufferedReader.java:136)
at java.io.BufferedReader.readLine(BufferedReader.java:299)
at java.io.BufferedReader.readLine(BufferedReader.java:362)
at com.enterprisedt.net.ftp.FTPControlSocket.readReply(FTPControlSocket.java:910)
at com.enterprisedt.net.ftp.FTPClient.validateTransfer(FTPClient.java:2112)
at com.enterprisedt.net.ftp.FTPClient.validateTransferOnError(FTPClient.java:2144)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2089)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2060)
at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:663)
at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:637)

1 Answer

0 votes
by (162k points)
The FTP server has timed out your connection because it is a long transfer. To transfer such large files you need to increase the timeout on the server.

Categories

...