3

下面是我的简单文件组件消费者到 ftp 生产者组件的路径。

from("file://C://fileFolder")
.to("ftp://ftp01.test.com/myfolder/?username=user1234&password=pass1234&delay=5s&ignoreFileNotFoundOrPermissionError=true");

当我粘贴一个简单的文本文件时,我遇到了“写入失败”的异常。

2016-01-15 10:55:37,663 | WARN  | C://fileFolder// | RemoteFileProducer               | 117 - org.apache.camel.camel-core - 2.14.1 | Writing file failed with: Error writing file [KURUMDANBANKAYA/F2090281225.txt]
2016-01-15 10:55:37,712 | INFO  | C://fileFolder// | Tracer                           | 117 - org.apache.camel.camel-core - 2.14.1 | ID-ESB01-55798-1452524440559-1-46 >>> (route21) ftp://ftp01.test.com.tr/KURUMDANBANKAYA/?delay=5s&ignoreFileNotFoundOrPermissionError=true&password=xxxxxx&username=garhdisigorta --> OnException[GenericFileOperationFailedException] <<< Pattern:InOnly, Headers:{CamelFileLastModified=1452848134261, CamelFileRelativePath=F2090281225.txt, CamelFileName=F2090281225.txt, CamelFileLength=486, CamelFileNameConsumed=F2090281225.txt, CamelFileNameOnly=F2090281225.txt, CamelFileAbsolutePath=C:\\fileFolder\F2090281225.txt, CamelFilePath=C:\\fileFolder\F2090281225.txt, CamelFileAbsolute=true, CamelFileParent=C:\\fileFolder}, BodyType:org.apache.camel.component.file.GenericFile, Body:[Body is file based: GenericFile[C:\\fileFolder\F2090281225.txt]]
2016-01-15 10:55:37,712 | INFO  | C://fileFolder// | Tracer                           | 117 - org.apache.camel.camel-core - 2.14.1 | ID-ESB01-55798-1452524440559-1-46 >>> OnException[GenericFileOperationFailedException] --> direct-vm://nip-dead-letter-channel <<< Pattern:InOnly, Headers:{CamelFileLastModified=1452848134261, CamelFileRelativePath=F2090281225.txt, CamelFileName=F2090281225.txt, CamelFileLength=486, CamelFileNameConsumed=F2090281225.txt, CamelFileNameOnly=F2090281225.txt, CamelFileAbsolutePath=C:\Target\fileFolder\F2090281225.txt, CamelFilePath=C:\Target\fileFolder\F2090281225.txt, CamelFileAbsolute=true, CamelFileParent=C:\Target\fileFolder}, BodyType:org.apache.camel.component.file.GenericFile, Body:[Body is file based: GenericFile[C:\Target\fileFolder\F2090281225.txt]]
2016-01-15 10:55:37,712 | ERROR | C://fileFolder// | FatalFallbackErrorHandler        | 117 - org.apache.camel.camel-core - 2.14.1 | Exception occurred while trying to handle previously thrown exception on exchangeId: ID-ESB01-55798-1452524440559-1-46 using: [Channel[sendTo(Endpoint[direct-vm://nip-dead-letter-channel])]]. The previous and the new exception will be logged in the following.
2016-01-15 10:55:37,712 | ERROR | C://fileFolder// | FatalFallbackErrorHandler        | 117 - org.apache.camel.camel-core - 2.14.1 | \--> Previous exception on exchangeId: ID-ESB01-55798-1452524440559-1-46
org.apache.camel.component.file.GenericFileOperationFailedException: Error writing file [myfolder/F2090281225.txt]
    at org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:279)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:165)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.component.file.remote.RemoteFileProducer.process(RemoteFileProducer.java:49)[237:org.apache.camel.camel-ftp:2.14.1]
    at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:152)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:304)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:147)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:416)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:433)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:211)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:175)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)[117:org.apache.camel.camel-core:2.14.1]
    at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)[117:org.apache.camel.camel-core:2.14.1]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_75]
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)[:1.7.0_75]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)[:1.7.0_75]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.7.0_75]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_75]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_75]
    at java.lang.Thread.run(Thread.java:745)[:1.7.0_75]

在谷歌搜索并阅读了一些与骆驼相关的博客之后,以下是我尝试过的试验和案例

  1. 检查网络防火墙 - 不阻止
  2. 检查 Windows 防火墙 - 不阻止
  3. 检查手动文件传输到 ftp - 工作
  4. 检查使用 commons-net-3.7.jar FTPClient 传输文件的 java 方式 - 工作

只有通过 servicemix 它不起作用。写入文件失败。有人解决了同样的问题吗?

4

2 回答 2

4

尝试添加passiveMode=true到 URI。

于 2017-04-18T12:07:24.243 回答
0

您的骆驼路线有错误:

from("file://C://fileFolder") .to(" ftp://ftp01.test.com/myfolder/?username=user1234&password= pass1234delay =5s&ignoreFileNotFoundOrPermissionError=true");

于 2016-01-19T10:26:27.963 回答