【问题标题】:Apache Camel FTP ComponentApache Camel FTP 组件
【发布时间】:2014-11-23 11:49:49
【问题描述】:

使用 Apache Camel 连接到本地安装的 FTP 服务器 (FileZilla) 时,出现以下异常。


16:27:45.974 INFO  [Camel (camel-1) thread #0 - ftp://x.x.x.x:21/in][org.apache.camel.component.file.remote.FtpConsumer] Connected and logged in to: ftp://kallada@x.x.x.x:21
16:27:45.980 WARN  [Camel (camel-1) thread #0 - ftp://x.x.x.x:21/in][org.apache.camel.component.file.remote.RemoteFilePollingConsumerPollStrategy] Trying to recover by disconnecting from remote server forcing a re-connect at next poll: ftp://kallada@x.x.x.x:21
16:27:45.980 WARN  [Camel (camel-1) thread #0 - ftp://x.x.x.x:21/in][org.apache.camel.component.file.remote.FtpConsumer] Error occurred while disconnecting from ftp://kallada@x.x.x.x:21 due: File operation failed:  Software caused connection abort: socket write error. Code: 215. This exception will be ignored.
16:27:45.981 WARN  [Camel (camel-1) thread #0 - ftp://x.x.x.x:21/in][org.apache.camel.component.file.remote.FtpConsumer] Consumer FtpConsumer[ftp://x.x.x.x:21/in?delay=5s&move=done&passiveMode=false&password=xxxxxx&username=kallada] failed polling endpoint: Endpoint[ftp://x.x.x.x:21/in?delay=5s&move=done&passiveMode=false&password=xxxxxx&username=kallada]. Will try again at next poll. Caused by: [org.apache.camel.component.file.GenericFileOperationFailedException - File operation failed:  Software caused connection abort: recv failed. Code: 215]
org.apache.camel.component.file.GenericFileOperationFailedException: File operation failed:  Software caused connection abort: recv failed. Code: 215
    at org.apache.camel.component.file.remote.FtpOperations.listFiles(FtpOperations.java:784)
    at org.apache.camel.component.file.remote.FtpConsumer.doPollDirectory(FtpConsumer.java:88)
    at org.apache.camel.component.file.remote.FtpConsumer.pollDirectory(FtpConsumer.java:51)
    at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:117)
    at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)
    at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketException: Software caused connection abort: recv failed
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at sun.nio.cs.StreamDecoder.readBytes(Unknown Source)
    at sun.nio.cs.StreamDecoder.implRead(Unknown Source)
    at sun.nio.cs.StreamDecoder.read(Unknown Source)
    at java.io.InputStreamReader.read(Unknown Source)
    at java.io.BufferedReader.fill(Unknown Source)
    at java.io.BufferedReader.read(Unknown Source)
    at org.apache.commons.net.io.CRLFLineReader.readLine(CRLFLineReader.java:58)
    at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:314)
    at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:294)
    at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:483)
    at org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:608)
    at org.apache.commons.net.ftp.FTP.port(FTP.java:932)
    at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:812)
    at org.apache.commons.net.ftp.FTPClient._openDataConnection_(FTPClient.java:759)
    at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3293)
    at org.apache.commons.net.ftp.FTPClient.initiateListParsing(FTPClient.java:3271)e 
    at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2930)
    at org.apache.commons.net.ftp.FTPClient.listFiles(FTPClient.java:2977)
    at org.apache.camel.component.file.remote.FtpOperations.listFiles(FtpOperations.java:777)
    ... 12 moreows 

FileZilla 服务器控制台显示以下跟踪。


(000043)23-11-2014 16:27:45 - (not logged in) (x.x.x.x)> Connected on port 21, sending welcome message...
(000043)23-11-2014 16:27:45 - (not logged in) (x.x.x.x)> USER kallada
(000043)23-11-2014 16:27:45 - (not logged in) (x.x.x.x)> 331 Password required for kallada
(000043)23-11-2014 16:27:45 - (not logged in) (x.x.x.x)> PASS *******
(000043)23-11-2014 16:27:45 - kallada (x.x.x.x)> 230 Logged on
(000043)23-11-2014 16:27:45 - kallada (x.x.x.x)> TYPE A
(000043)23-11-2014 16:27:45 - kallada (x.x.x.x)> 200 Type set to A
(000043)23-11-2014 16:27:45 - kallada (x.x.x.x)> PWD
(000043)23-11-2014 16:27:45 - kallada (x.x.x.x)> 257 "/" is current directory.
(000043)23-11-2014 16:27:45 - kallada (x.x.x.x)> CWD in
(000043)23-11-2014 16:27:45 - kallada (x.x.x.x)> 250 CWD successful. "/in" is current directory.
(000043)23-11-2014 16:27:45 - kallada (x.x.x.x)> SYST
(000043)23-11-2014 16:27:45 - kallada (x.x.x.x)> 215 UNIX emulated by FileZilla
(000043)23-11-2014 16:27:45 - kallada (x.x.x.x)> disconnected.

路由定义如下

ftp://x.x.x.x:21/in?username=kallada&password=xxxxxx&passiveMode=false&delay=5s&move=done

任何解决此问题的建议都会有所帮助。

【问题讨论】:

    标签: java ftp apache-camel


    【解决方案1】:

    请检查防火墙是否设置为阻止 FTP 通信。

    【讨论】:

    • 非常感谢。关闭 Windows 防火墙后运行我的应用程序。它按预期工作。
    猜你喜欢
    • 2023-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-09
    • 1970-01-01
    • 1970-01-01
    • 2017-08-22
    相关资源
    最近更新 更多