<camelContext id="context" xmlns="http://camel.apache.org/schema/spring";>
<dataFormats>
          <bindy id="formatStopNotificationFonix" type="Csv"
classType="com.test.file.processor.model.Test"/>
        </dataFormats>

<route id="route-retriev-file" autoStartup="true">
<from uri="sftp:
192.168.13.50:22/?password=password&amp;username=user&amp;move=/home/processed/
"/>
<unmarshal>
<custom ref="formatTest"/>
</unmarshal>
<split>
<simple>${body}</simple>
<log message="Name: ${body.name} Address: ${body.address}"/>
</split>
</route>
</camelContext>


its print all the logs  with name and address but after printing all Its
throwing below exception

org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
rename file from: test.txt to: home/gcfonix/processed/test.txt
at
org.apache.camel.component.file.remote.SftpOperations.renameFile(SftpOperations.java:508)
at
org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFile(GenericFileProcessStrategySupport.java:147)
at
org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:121)
at
org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:133)
at
org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:85)
at
org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:59)
at
org.apache.camel.support.UnitOfWorkHelper.doneSynchronizations(UnitOfWorkHelper.java:91)
at
org.apache.camel.impl.engine.DefaultUnitOfWork.done(DefaultUnitOfWork.java:218)
at
org.apache.camel.support.UnitOfWorkHelper.doneUow(UnitOfWorkHelper.java:54)
at
org.apache.camel.impl.engine.CamelInternalProcessor$UnitOfWorkProcessorAdvice.after(CamelInternalProcessor.java:680)
at
org.apache.camel.impl.engine.CamelInternalProcessor$UnitOfWorkProcessorAdvice.after(CamelInternalProcessor.java:623)
at
org.apache.camel.impl.engine.CamelInternalProcessor$AsyncAfterTask.done(CamelInternalProcessor.java:199)
at org.apache.camel.AsyncCallback.run(AsyncCallback.java:44)
at
org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
at
org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)
at
org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:312)
at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:486)
at
org.apache.camel.component.file.remote.RemoteFileConsumer.processExchange(RemoteFileConsumer.java:147)
at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:240)
at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:201)
at
org.apache.camel.support.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:190)
at
org.apache.camel.support.ScheduledPollConsumer.run(ScheduledPollConsumer.java:107)
at
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at
java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: com.jcraft.jsch.SftpException: No such file
at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2873)
at com.jcraft.jsch.ChannelSftp.rename(ChannelSftp.java:1950)
at
org.apache.camel.component.file.remote.SftpOperations.renameFile(SftpOperations.java:504)
... 28 common frames omitted

its although successfully creates the directory but doesn't move the file

Reply via email to