here is my code and log. Thanks !!!
FileTransferClient ftp = new FileTransferClient();
ftp.setTimeout(MaxFTPTimeout); //this timeout is 2 minutes, but why get java.net.SocketException after about 10 minutes
ftp.setUserName( destination.getUserName() );
ftp.setPassword( destination.getPassword() );
ftp.setContentType(FTPTransferType.BINARY);
ftp.setEventListener(monitor);
ftp.setRemoteHost((String)destination.getHost());
if (destination.getPort() != null)
ftp.setRemotePort(((Integer)destination.getPort()).intValue());
try {
ftp.uploadFile((String)source.getFileName(), (String)destination.getFileName() + ".tmp");
Thread.sleep(FTPsleep);
}
catch (java.io.InterruptedIOException e) {
sendNotification(NotificationType.FTP_PROGRESS, slotNumber +
"java.io.InterruptedIOException Problem transferring (dest): " + destination.getHost() + " " + e.toString(), token);
return returnError("java.io.InterruptedIOException Problem transferring (dest): " + destination.getHost() + " " + e.toString());
}
catch (Exception e) {
sendNotification(NotificationType.FTP_PROGRESS, slotNumber +
"ftp.put Exception Problem transferring (dest): " + destination.getHost() + " " + e.toString(), token);
return returnError("ftp.put Exception Problem transferring (dest): " + destination.getHost() + " " + e.toString());
}
30 Jun 2008 21:01:04,940 [Chassis Pool] DEBUG - forward notification module.transfer.progress
30 Jun 2008 21:01:04,940 [Chassis Pool] DEBUG - updateSummaryStatus 9/pon2/7: Connecting via ftp... false false
30 Jun 2008 21:01:04,940 [Chassis Pool] DEBUG - Connecting to /10.255.92.7:21
30 Jun 2008 21:01:04,960 [Chassis Pool] DEBUG - forward notification module.transfer.progress
30 Jun 2008 21:01:04,980 [Chassis Pool] DEBUG - updateSummaryStatus 9/pon2/7: Logging in... false false
30 Jun 2008 21:01:04,980 [Chassis Pool] DEBUG - forward notification module.transfer.progress
30 Jun 2008 21:01:04,980 [Chassis Pool] DEBUG - updateSummaryStatus 9/pon2/7: Starting transfer... false false
30 Jun 2008 21:01:06,140 [Chassis Pool] DEBUG - updateSummaryStatus 9/pon2/7: onte_test.imz.w7 2% false false
30 Jun 2008 21:01:10,820 [Chassis Pool] DEBUG - updateSummaryStatus 9/pon2/7: onte_test.imz.w7 7% false false........
..
30 Jun 2008 21:01:21,720 [Chassis Pool] DEBUG - updateSummaryStatus 9/pon2/7: onte_test.imz.w7 21% false false
30 Jun 2008 21:01:28,440 [Chassis Pool] DEBUG - forward notification module.transfer.progress
30 Jun 2008 21:01:28,440 [Chassis Pool] DEBUG - updateSummaryStatus 9/pon2/7: onte_test.imz.w7 29% false false
fiber unplugged (disconnected)
....
30 Jun 2008 21:10:30,720 [Chassis Pool] DEBUG - Validate transfer on error after exception
java.net.SocketException: Broken pipe: socket write error
at java.net.SocketOutputStream.write([BII)V [line 186]
at java.io.DataOutputStream.write([BII)V [line 43]
at java.io.BufferedOutputStream.flush()V [line 63]
at java.io.BufferedOutputStream.write([BII)V [line 47]
at com.enterprisedt.com.ftp.FTPClient.putData(FTPClient.java:2396)
at com.enterprisedt.com.ftp.FTPClient.put(FTPClient.java:2080)
at com.enterprisedt.com.ftp.FTPClient.put(FTPClient.java:2062)
at com.enterprisedt.com.ftp.FileTransferClient.uploadFile(FileTransferClient.java:663)
at com.enterprisedt.com.ftp.FileTransferClient.uploadFile(FileTransferClient.java:637)
......
30 Jun 2008 21:10:31,220 [Chassis Pool] WARN - Validate transfer on error failed
java.net.SocketTimeoutException: Read timed out
at java.net.PERCSocketImpl.receive([BII)I [native]
at java.net.SocketInputStream.read([BII)I [line 116]
at COM.newmonics.io.Encoder.refillBuffer()V [line 795]
at COM.newmonics.io.ASCIIEncoder.getNextChar(Z)I [line 274]
at COM.newmonics.io.ASCIIEncoder.getChars([CII)I [line 226]
at java.io.InputStreamReader.read([CII)I [line 90]
at java.io.BufferedReader.refill()Z [line 393]
at java.io.BufferedReader.nextChar()I [line 408]
at java.io.BufferedReader.readLine()Ljava/lang/String; [line 200]
at com.enterprisedt.com.ftp.FTPControlSocket.readReply(FTPControlSocket.java:910)
at com.enterprisedt.com.ftp.FTPClient.validateTransfer(FTPClient.java:2114)
at com.enterprisedt.com.ftp.FTPClient.validateTransferOnError(FTPClient.java:2146)
at com.enterprisedt.com.ftp.FTPClient.put(FTPClient.java:2091)
at com.enterprisedt.com.ftp.FTPClient.put(FTPClient.java:2062)
at com.enterprisedt.com.ftp.FileTransferClient.uploadFile(FileTransferClient.java:663)
at com.enterprisedt.com.ftp.FileTransferClient.uploadFile(FileTransferClient.java:637)
......
30 Jun 2008 21:10:31,220 [Chassis Pool] DEBUG - forward notification module.transfer.progress
30 Jun 2008 21:10:31,220 [Chassis Pool] DEBUG - updateSummaryStatus 9/pon2/7ftp.put Exception Problem transferring (dest): 10.255.92.7 java.net.SocketException: Broken pipe: socket write error false false