commons-net-3.3 ftpClient上傳檔案報錯java.net.socketexception: connection timed out
FTPClient ftpClient = new FTPClient();
FileInputStream fileInputStream;
try {
ftpClient.connect(HOST);
ftpClient.login(USER_NAME, PASSWORD);
ftpClient.enterLocalPassiveMode();
fileInputStream = new FileInputStream(reconciliationFile);
Boolean isSuccess = ftpClient.storeFile("/" + PATH + "/" + reconciliationFile.getName(), fileInputStream);
logger.info("上傳取暖對賬檔案結果:{}",isSuccess.toString());
reconciliationFile.deleteOnExit();
return true;
} catch (IOException e) {
logger.info(e.getMessage(), e);
throw new RuntimeException("FTP客戶端出錯!", e);
}
}
如果沒有
ftpClient.enterLocalPassiveMode();
將會丟擲異常java.net.socketexception: connection timed out
或者isSuccess的將為false;
相關文章
- WARNING: inbound connection timed out (ORA-3136)錯誤分析
- ORA-3136錯誤分析——WARNING Inbound Connection Timed Out
- JMETER java.net.SocketException: Connection reset 報錯解決方案JMeterJavaException
- 【Oracle】 inbound connection timed out (ORA-3136)Oracle
- pip安裝selenium報錯:Read timed out
- CM agent 傳送heartbeat給CM server 不斷髮生 connection refused:timed outServer
- 報錯(已解決)Command timed out after no timeout
- Hadoop hdfs上傳檔案報錯解決Hadoop
- 執行systemctl status ssh返回“Failed to get properties: Connection timed out”AI
- [Clickhouse] Clickhouse 報SQLException : Read timed outSQLException
- JAVA中使用FTPClient上傳下載JavaFTPclient
- PHP 上傳檔案 move_uploaded_file 報錯PHP
- oozie.action.hadoop.LauncherException: IO error Connection timed out: no further informationHadoopExceptionErrorORM
- ASP.NET上傳大檔案報錯,IIS7.0ASP.NET
- Ueditor 上傳圖片自動新增水印(只能上傳圖片,上傳檔案報錯)
- Nginx 報錯413 Request Entity Too Large 上傳檔案過大Nginx
- php檔案上傳之多檔案上傳PHP
- 上傳專案到gitHub,上傳報錯和刪除gitHub上的專案Github
- 上傳圖片和檔案出錯!!!
- open-falcon ---安裝Dashboard時候報錯"SSLError: The read operation timed out"Error
- adstrtal.sh報超時錯誤 ERROR : Timed out( 100000 ): Interrupted ExceptionErrorException
- WARNING: inbound connection timed out (ORA-3136)連線超時問題
- java.sql.SQLException:IO 錯誤:Socket read timed out !JavaSQLException
- Oracle RAC root.sh 報錯 Timed out waiting for the CRS stack to start 解決方法OracleAI
- 單個檔案上傳和批量檔案上傳
- beego檔案上傳使用getFile出錯Go
- Putty或MobaXTerm無法連線VMware虛擬機器 報Network error: Connection timed out的解決方案虛擬機Error
- 檔案上傳
- SpringMVC 單檔案上傳與多檔案上傳SpringMVC
- pip 下載報"connection to pypi.org time out"
- GoldenGate Pump Porcess: TCP/IP error 110 (Connection timed out)的問題解決GoTCPError
- Oracle10g R2 RAC: WARNING: inbound connection timed out (ORA-3136)Oracle
- Uedior上傳大檔案超時報錯
- 檔案上傳之三基於flash的檔案上傳
- Flask——檔案上傳Flask
- PHP上傳檔案PHP
- JavaScript 檔案上傳JavaScript
- Git上傳檔案Git