kallada
kallada

Reputation: 1929

Apache Camel FTP Component

While connecting to a locally installed FTP server (FileZilla) using Apache Camel I'm getting the following exception.


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://[email protected]: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://[email protected]: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://[email protected]: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 

The FileZilla server console shows the following trace.


(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.

The route definition is as follows

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

Any pointers to solve this issue would be helpful.

Upvotes: 1

Views: 2621

Answers (1)

Peter Keller
Peter Keller

Reputation: 7646

Please, check if the firewall is set to block FTP communication.

Upvotes: 2

Related Questions