Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
6.1k views
in Java FTP by (160 points)
I'm getting the following error when I try to run my java application that access an ftp server. It runs fine on server A but then intermittently has this error when I try to run it on a new server "B"

java.net.SocketException: Software caused connection abort: 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 sun.nio.cs.StreamEncoder.writeBytes(Unknown Source) at sun.nio.cs.StreamEncoder.implFlushBuffer(Unknown Source) at sun.nio.cs.StreamEncoder.implFlush(Unknown Source) at sun.nio.cs.StreamEncoder.flush(Unknown Source) at java.io.OutputStreamWriter.flush(Unknown Source) at com.enterprisedt.net.ftp.FTPControlSocket.writeCommand(FTPControlSocket.java:894) at com.enterprisedt.net.ftp.FTPControlSocket.sendCommand(FTPControlSocket.java:875) at com.enterprisedt.net.ftp.FTPClient.quit(FTPClient.java:3516) at com.enterprisedt.net.ftp.FileTransferClient.disconnect(FileTransferClient.java:849) at com.bhep.adp.helpers.FTPHelpers.getFileFromFTPServer(FTPHelpers.java:86) 


Any ideas why this would be just happening on the new server and not the original server? FYI it is the same compiled jar on both servers.

Thanks
Troy

2 Answers

0 votes
by (51.6k points)
If it only happens during the disconnect call then it's probably because the server is shutting the connection prematurely. In this case it's safe to ignore the error. It's also fine to pass true to disconnect as this will just kill the connection and hence avoid the problem. I've never encountered a server which required a neat disconnection, so as far I know it's always OK to kill the connection abruptly.

- Hans (EnterpriseDT)
0 votes
by (160 points)
Thank you. I will give that a try to see if it solves the problem.

Categories

...