Hi,

 

I'm using commons-net-1.4.1.jar library to implements a FTP client. I'm seeing 
Broken pipe Socket exception from time to time, when I try to get the list of 
files on the server or when I try to download a file. The weird thing is that I 
do not get a FTPConnectionClosedException, so it means that the socket was not 
closed. Also, whenever I get an exception, I retry the same operation with the 
same ftpclient just after, and most of the time it succeed at the second try, 
but sometimes it keeps failing.

This does not happen always, just from time to time, so I don't really 
understand why this occurs.This is really not consistent.

 

For information, I'm setting this for the ftp client :

ftpClient.enterLocalActiveMode();

ftpClient.setDataTimeout(30000);

 

this Is one of the stack trace I'm getting: 

Caused by: java.net.SocketException: Broken pipe

            at java.net.SocketOutputStream.socketWrite0(Native Method)

            at 
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)

            at java.net.SocketOutputStream.write(SocketOutputStream.java:136)

            at 
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)

            at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)

            at 
org.apache.commons.net.telnet.TelnetClient._flushOutputStream(TelnetClient.java:77)

            at 
org.apache.commons.net.telnet.TelnetOutputStream.flush(TelnetOutputStream.java:137)

            at java.io.FilterOutputStream.flush(FilterOutputStream.java:123)

            at 
sun.nio.cs.StreamEncoder$CharsetSE.implFlush(StreamEncoder.java:410)

            at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:152)

            at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213)

            at java.io.BufferedWriter.flush(BufferedWriter.java:236)

            at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:442)

            at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:520)

            at org.apache.commons.net.ftp.FTP.port(FTP.java:849)

            at 
org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:477)

            at 
org.apache.commons.net.ftp.FTPClient.listNames(FTPClient.java:1959)

            at 
org.apache.commons.net.ftp.FTPClient.listNames(FTPClient.java:2006)

            at 
tradingscreen.core.services.enso.clients.impl.TradingCentralClient.getFilesOnServer(TradingCentralClient.java:201)

            ... 11 more

 

Does someone have an idea, why this is happening?

 

Thanks,

 

Mélanie Langlois 
  



 

Reply via email to