文件操作失败:550无法更改目录。无法将目录更改为:OUT。代码:550

时间:2014-03-12 09:33:06

标签: java ftp apache-camel apache-servicemix

以下是apache camel路由,我正在Apache Service Mix 4.5.3中部署。

<route>
    <from uri="activemq:queue:EDI.CONTAINER.OUTBOUND.MESSAGES" />
    <to uri="ftp://user@127.0.0.1:21/sin/file/in/?password=password"/>
    <bean ref="processService" method="doProcess" />
</route>

以下堆栈跟踪和文件未写入FTP。

在FTP中,它会创建一个名为“sin \ file \ in”的文件夹,而不是三个文件夹(sin - &gt; file - &gt; in)

    at org.apache.camel.component.file.remote.FtpOperations.doChangeDirectory(FtpOperations.java:705)[218:org.apache.camel.camel-ftp:2.10.7]
    at org.apache.camel.component.file.remote.FtpOperations.changeCurrentDirectory(FtpOperations.java:683)[218:org.apache.camel.camel-ftp:2.10.7]
    at org.apache.camel.component.file.remote.FtpOperations.storeFile(FtpOperations.java:469)[218:org.apache.camel.camel-ftp:2.10.7]
    at org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:249)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:151)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.component.file.remote.RemoteFileProducer.process(RemoteFileProducer.java:49)[218:org.apache.camel.camel-ftp:2.10.7]
    at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:335)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:104)[106:org.apache.camel.camel-jms:2.10.7]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560)[104:org.springframework.jms:3.0.7.RELEASE]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498)[104:org.springframework.jms:3.0.7.RELEASE]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)[104:org.springframework.jms:3.0.7.RELEASE]
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)[104:org.springframework.jms:3.0.7.RELEASE]
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)[104:org.springframework.jms:3.0.7.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)[104:org.springframework.jms:3.0.7.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)[104:org.springframework.jms:3.0.7.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)[104:org.springframework.jms:3.0.7.RELEASE]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_25]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_25]
    at java.lang.Thread.run(Thread.java:724)[:1.7.0_25]
17:01:08,003 | WARN  | TBOUND.MESSAGES] | EndpointMessageListener          | 100 - org.apache.camel.camel-core - 2.10.7 | Execution of JMS message listener failed. Caused by: [org.apache.camel.component.file.GenericFileOperationFailedException - File operation failed: 550 Failed to change directory.
 Cannot change directory to: OUT. Code: 550]
org.apache.camel.component.file.GenericFileOperationFailedException: File operation failed: 550 Failed to change directory.
 Cannot change directory to: OUT. Code: 550
    at org.apache.camel.component.file.remote.FtpOperations.doChangeDirectory(FtpOperations.java:705)[218:org.apache.camel.camel-ftp:2.10.7]
    at org.apache.camel.component.file.remote.FtpOperations.changeCurrentDirectory(FtpOperations.java:683)[218:org.apache.camel.camel-ftp:2.10.7]
    at org.apache.camel.component.file.remote.FtpOperations.storeFile(FtpOperations.java:469)[218:org.apache.camel.camel-ftp:2.10.7]
    at org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:249)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:151)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.component.file.remote.RemoteFileProducer.process(RemoteFileProducer.java:49)[218:org.apache.camel.camel-ftp:2.10.7]
    at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:335)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)[100:org.apache.camel.camel-core:2.10.7]
    at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:104)[106:org.apache.camel.camel-jms:2.10.7]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560)[104:org.springframework.jms:3.0.7.RELEASE]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498)[104:org.springframework.jms:3.0.7.RELEASE]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)[104:org.springframework.jms:3.0.7.RELEASE]
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)[104:org.springframework.jms:3.0.7.RELEASE]
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)[104:org.springframework.jms:3.0.7.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)[104:org.springframework.jms:3.0.7.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)[104:org.springframework.jms:3.0.7.RELEASE]
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)[104:org.springframework.jms:3.0.7.RELEASE]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_25]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_25]
    at java.lang.Thread.run(Thread.java:724)[:1.7.0_25]

1 个答案:

答案 0 :(得分:0)

我认为你的uri可能是一个问题,因为你正在使用/后跟?

尝试使用

ftp://user@127.0.0.1:21/sin/file/in?password=password

ftp://user@127.0.0.1:21/sin/file/in/password=password

如果这没有帮助,也可以逐步尝试:

ftp://user@127.0.0.1:21/sin/file/in/password=password&stepwise=true