Problem Description : The code runs on linux server time to time there will be an exception
org.apache.commons.net.io.CopyStreamException: IOException caught while copying.
at org.apache.commons.net.io.Util.copyStream (Util.java: 127)
at org.apache.commons.net.ftp.FTPClient.retrieveFile (FTPClient.java: 1295)
at com.common.util.FTPUtil.downLoadFile (FTPUtil.java: 168)
at com.common.util.FTPUtil.downloadCSVFromFTP (FTPUtil.java: 107)
This exception would not have run again the
There is also an unusual case
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read (Unknown Source)
at java.io.BufferedInputStream.fill (Unknown Source)
at java.io.BufferedInputStream.read (Unknown Source)
at java.io.FilterInputStream.read (Unknown Source)
at java.io.PushbackInputStream.read (Unknown Source)
at org.apache.commons.net.io.FromNetASCIIInputStream.__read (FromNetASCIIInputStream.java: 75)
at org.apache.commons.net.io.FromNetASCIIInputStream.read (FromNetASCIIInputStream.java: 170)
at java.io.BufferedInputStream.fill (Unknown Source)
at java.io.BufferedInputStream.read (Unknown Source)
at org.apache.commons.net.telnet.TelnetInputStream.__read (TelnetInputStream.java: 114)
at org.apache.commons.net.telnet.TelnetInputStream.run (TelnetInputStream.java: 535)
at java.lang.Thread.run (Unknown Source)
The two exceptions are not regularly occur , run the program again on the normal, large cattle may ask what is the reason ? After the file download code aspects FTPClient also closed, the stream has been closed
------ Solution ------------------------- -------------------
not understand but under Bangniding
way also learn
------ Solution - -------------------------------------------
first exception too little information , no specific source, I do not understand that thing
The second Connection Reset is a common abnormality , basically you artificially severed network connections , leading to forced disconnect the connection
this for many reasons, network instability , system instability,
But the main reason I guess it should be on a network node intentionally disconnected , I am a VPS server is the case , in order to prevent DDOS attacks , as long as they are detected in the engine room there is a large amount of data transmission, will active shielding that connection , the connection dropped
------ For reference only ------------------------------ ---------
Meirenhuida their top
------ For reference only --------------------- ------------------
3q, after repeated testing of these two anomalies are due to issues like network , first because the network is unstable Download directly forced to interrupt the
没有评论:
发表评论