Hello,
I am using edtFTPj/Free version 2.0.2
I am getting this error -
java.net.SocketException: Connection reset by peer: socket write error
when doing this -
FileTransferClient ftp = new FileTransferClient();
ftp.setRemoteHost(host);
ftp.setUserName(user);
ftp.setPassword(password);
ftp.connect();
ftp.getAdvancedFTPSettings().setConnectMode(FTPConnectMode.PASV);
ftp.setContentType(FTPTransferType.BINARY);
ftp.changeDirectory(directory);
while ( st.hasMoreTokens() )
{
ftp.uploadFile(resultDir + localFile, remoteFile);
}
ftp.disconnect();
The error does not happen every time, maybe 10% of the time.
Any help would be appreciated.
This is the debug info -
DEBUG [FTPClient] 21 May 2008 13:14:00.975 : Class: com.enterprisedt.net.ftp.FTPClient
Version: 2.0.2
Build timestamp: 31-Mar-2008 14:30:20 EST
Java version: 1.5.0_06
CLASSPATH: .\;..\;C:\Program .\;..\;C:\Program Files\Java\jre1.5.0_06\lib;D:\Webprojects\DEV\CDCINFO\scripts\DX\newDXI\mail.jar;D:\Webprojects\DEV\CDCINFO\scripts\DX\newDXI\activation.jar;D:\Webprojects\DEV\CDCINFO\scripts\DX\newDXI\jtds-0.9.jar;D:\Webprojects\DEV\CDCINFO\scripts\DX\newDXI\edtftpj-2.0.2.jar;
OS name: Windows 2003
OS arch: x86
OS version: 5.2
DEBUG [FileTransferClient] 21 May 2008 13:14:00.975 : Configured client
DEBUG [FTPClient] 21 May 2008 13:14:00.975 : Connecting to /10.24.253.11:21
DEBUG [SocketUtils] 21 May 2008 13:14:00.975 : Invoking connect with timeout=60000
DEBUG [SocketUtils] 21 May 2008 13:14:01.68 : Connected successfully
DEBUG [FTPControlSocket] 21 May 2008 13:14:01.162 : 220 Microsoft FTP Service
DEBUG [FileTransferClient] 21 May 2008 13:14:01.162 : Client connected
DEBUG [FileTransferClient] 21 May 2008 13:14:01.162 : Logging in
DEBUG [FTPControlSocket] 21 May 2008 13:14:01.162 : ---> USER FTPUser
DEBUG [FTPControlSocket] 21 May 2008 13:14:01.256 : 331 Password required for FTPUser.
DEBUG [FTPControlSocket] 21 May 2008 13:14:01.256 : ---> PASS ********
DEBUG [FTPControlSocket] 21 May 2008 13:14:01.350 : 230 User FTPUser logged in.
DEBUG [FileTransferClient] 21 May 2008 13:14:01.350 : Logged in
DEBUG [FTPControlSocket] 21 May 2008 13:14:01.350 : ---> TYPE I
DEBUG [FTPControlSocket] 21 May 2008 13:14:01.443 : 200 Type set to I.
DEBUG [FTPControlSocket] 21 May 2008 13:14:01.443 : ---> TYPE I
DEBUG [FTPControlSocket] 21 May 2008 13:14:01.537 : 200 Type set to I.
DEBUG [FTPControlSocket] 21 May 2008 13:14:01.537 : ---> CWD content\dev
DEBUG [FTPControlSocket] 21 May 2008 13:14:01.631 : 250 CWD command successful.
DEBUG [FTPControlSocket] 21 May 2008 13:14:01.631 : ---> PASV
DEBUG [FTPControlSocket] 21 May 2008 13:14:01.725 : 227 Entering Passive Mode (10,24,253,11,9,174).
DEBUG [FTPControlSocket] 21 May 2008 13:14:01.725 : Substituting server supplied IP (10.24.253.11) with remote host IP (10.24.253.11)
DEBUG [FTPControlSocket] 21 May 2008 13:14:01.818 : ---> STOR siebel-delete-out.xml
DEBUG [FTPControlSocket] 21 May 2008 13:14:01.912 : 125 Data connection already open; Transfer starting.
DEBUG [FTPClient] 21 May 2008 13:14:03.287 : Transferred 133956 bytes to remote host
DEBUG [FTPControlSocket] 21 May 2008 13:14:03.381 : 226 Transfer complete.
DEBUG [FTPControlSocket] 21 May 2008 13:14:03.381 : ---> PASV
DEBUG [FTPControlSocket] 21 May 2008 13:14:03.475 : 227 Entering Passive Mode (10,24,253,11,9,175).
DEBUG [FTPControlSocket] 21 May 2008 13:14:03.475 : Substituting server supplied IP (10.24.253.11) with remote host IP (10.24.253.11)
DEBUG [FTPControlSocket] 21 May 2008 13:14:03.568 : ---> STOR siebel-delete-out.txt
DEBUG [FTPControlSocket] 21 May 2008 13:14:03.662 : 125 Data connection already open; Transfer starting.
DEBUG [FTPClient] 21 May 2008 13:14:03.678 : Transferred 22325 bytes to remote host
DEBUG [FTPControlSocket] 21 May 2008 13:14:04.756 : 226 Transfer complete.
DEBUG [FTPControlSocket] 21 May 2008 13:14:04.756 : ---> PASV
DEBUG [FTPControlSocket] 21 May 2008 13:14:04.912 : 227 Entering Passive Mode (10,24,253,11,9,176).
DEBUG [FTPControlSocket] 21 May 2008 13:14:04.912 : Substituting server supplied IP (10.24.253.11) with remote host IP (10.24.253.11)
DEBUG [FTPControlSocket] 21 May 2008 13:14:05.6 : ---> STOR siebel-content-out.xml
DEBUG [FTPControlSocket] 21 May 2008 13:14:05.100 : 125 Data connection already open; Transfer starting.
ERROR [FTPClient] 21 May 2008 13:14:18.177 : Caught and rethrowing exception in getDataAfterInitGet() : Connection reset by peer: socket write error
java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(Unknown Source)
at java.net.SocketOutputStream.write(Unknown Source)
at java.io.DataOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.write(Unknown Source)
at com.enterprisedt.net.ftp.FTPClient.putData(FTPClient.java:2380)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2065)
at com.enterprisedt.net.ftp.FTPClient.put(FTPClient.java:2047)
at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:639)
at com.enterprisedt.net.ftp.FileTransferClient.uploadFile(FileTransferClient.java:613)
at NewDXI.FTPResultsToPoroduction(NewDXI.java:5622)
at NewDXI.findAndRunProcStep(NewDXI.java:3605)
at NewDXI.runProcesses(NewDXI.java:644)
at NewDXI.initializeAndRun(NewDXI.java:273)
at NewDXI.main(NewDXI.java:161)