Hi Next time please use the @user mailing list for Camel questions.
You may be hit by https://issues.apache.org/jira/browse/CAMEL-5582 The workaround is to add a .convertBodyTo(byte[].class) , eg after the from. On Mon, Sep 10, 2012 at 7:03 PM, ckalirasa <ckalir...@yahoo.com> wrote: > Hi: > I am trying to delete the original files after backing up and encrypted. > Files are moved and ecrypted successfully. However, it fail to delete the > files: > > Code: > > public class FileCopierWithCamel{ > > public static void main(String args[]) throws Exception { > // create CamelContext > CamelContext context = new DefaultCamelContext(); > > // add our route to the CamelContext > context.addRoutes(new RouteBuilder() { > public void configure() { > > from("file://inputdir?include=.*\\.pdf&delay=100&delete=true") > .to("file://backup") > .marshal().pgp("file:data/key/pubring.gpg",""); > .to("file://encrypted?fileName=${file:name}.PGP"); > > } > }); > > // start the route and let it do its work > context.start(); > Thread.sleep(10000); > > // stop the CamelContext > //.stop(); > } > } > > Error: > > [1) thread #1 - file://inputdir] FileConsumer DEBUG Took > 0.000 seconds to poll: inputdir > [1) thread #1 - file://inputdir] FileConsumer DEBUG Total > 2 files to consume > [1) thread #1 - file://inputdir] FileConsumer DEBUG About > to process file: GenericFile[hrplus_cjo_sampleTestFile.pdf] using exchange: > Exchange[hrplus_cjo_sampleTestFile.pdf] > [1) thread #1 - file://inputdir] SendProcessor DEBUG >>>> > Endpoint[file://backup] Exchange[hrplus_cjo_sampleTestFile.pdf] > [1) thread #1 - file://inputdir] FileOperations DEBUG Using > FileChannel to write file: backup\hrplus_cjo_sampleTestFile.pdf > [1) thread #1 - file://inputdir] GenericFileProducer DEBUG Wrote > [backup\hrplus_cjo_sampleTestFile.pdf] to [Endpoint[file://backup]] > [1) thread #1 - file://inputdir] GenericFileConverter DEBUG Read > file inputdir\hrplus_cjo_sampleTestFile.pdf (no charset) > [1) thread #1 - file://inputdir] SendProcessor DEBUG >>>> > Endpoint[file://encrypted?fileName=%24%7Bfile%3Aname%7D.PGP] Exchange[null] > [1) thread #1 - file://inputdir] FileOperations DEBUG Using > InputStream to write file: encrypted\hrplus_cjo_sampleTestFile.pdf.PGP > [1) thread #1 - file://inputdir] GenericFileProducer DEBUG Wrote > [encrypted\hrplus_cjo_sampleTestFile.pdf.PGP] to > [Endpoint[file://encrypted?fileName=%24%7Bfile%3Aname%7D.PGP]] > [1) thread #1 - file://inputdir] GenericFileOnCompletion DEBUG Done > processing file: GenericFile[hrplus_cjo_sampleTestFile.pdf] using exchange: > Exchange[null] > [1) thread #1 - file://inputdir] FileUtil DEBUG > Retrying attempt 0 to delete file: > C:\camel\camelinaction-source\chapter1\file-copy\inputdir\hrplus_cjo_sampleTestFile.pdf.camelLock > [1) thread #1 - file://inputdir] FileUtil DEBUG Tried > 1 to delete file: > C:\camel\camelinaction-source\chapter1\file-copy\inputdir\hrplus_cjo_sampleTestFile.pdf.camelLock > with result: true > [1) thread #1 - file://inputdir] FileUtil DEBUG > Retrying attempt 0 to delete file: > C:\camel\camelinaction-source\chapter1\file-copy\inputdir\hrplus_cjo_sampleTestFile.pdf > [1) thread #1 - file://inputdir] FileUtil DEBUG > Retrying attempt 1 to delete file: > C:\camel\camelinaction-source\chapter1\file-copy\inputdir\hrplus_cjo_sampleTestFile.pdf > [1) thread #1 - file://inputdir] FileUtil DEBUG > Retrying attempt 2 to delete file: > C:\camel\camelinaction-source\chapter1\file-copy\inputdir\hrplus_cjo_sampleTestFile.pdf > [1) thread #1 - file://inputdir] FileUtil DEBUG Tried > 3 to delete file: > C:\camel\camelinaction-source\chapter1\file-copy\inputdir\hrplus_cjo_sampleTestFile.pdf > with result: false > [1) thread #1 - file://inputdir] FileUtil DEBUG > Retrying attempt 0 to delete file: > C:\camel\camelinaction-source\chapter1\file-copy\inputdir\hrplus_cjo_sampleTestFile.pdf > [1) thread #1 - file://inputdir] FileUtil DEBUG > Retrying attempt 1 to delete file: > C:\camel\camelinaction-source\chapter1\file-copy\inputdir\hrplus_cjo_sampleTestFile.pdf > [1) thread #1 - file://inputdir] FileUtil DEBUG > Retrying attempt 2 to delete file: > C:\camel\camelinaction-source\chapter1\file-copy\inputdir\hrplus_cjo_sampleTestFile.pdf > [1) thread #1 - file://inputdir] FileUtil DEBUG Tried > 3 to delete file: > C:\camel\camelinaction-source\chapter1\file-copy\inputdir\hrplus_cjo_sampleTestFile.pdf > with result: false > [1) thread #1 - file://inputdir] FileUtil DEBUG > Retrying attempt 0 to delete file: > C:\camel\camelinaction-source\chapter1\file-copy\inputdir\hrplus_cjo_sampleTestFile.pdf > [1) thread #1 - file://inputdir] FileUtil DEBUG > Retrying attempt 1 to delete file: > C:\camel\camelinaction-source\chapter1\file-copy\inputdir\hrplus_cjo_sampleTestFile.pdf > [1) thread #1 - file://inputdir] FileUtil DEBUG > Retrying attempt 2 to delete file: > C:\camel\camelinaction-source\chapter1\file-copy\inputdir\hrplus_cjo_sampleTestFile.pdf > [1) thread #1 - file://inputdir] FileUtil DEBUG Tried > 3 to delete file: > C:\camel\camelinaction-source\chapter1\file-copy\inputdir\hrplus_cjo_sampleTestFile.pdf > with result: false > [1) thread #1 - file://inputdir] GenericFileOnCompletion WARN Caused > by: [org.apache.camel.component.file.GenericFileOperationFailedException - > Cannot delete file: GenericFile[hrplus_cjo_sampleTestFile.pdf]] > org.apache.camel.component.file.GenericFileOperationFailedException: Cannot > delete file: GenericFile[hrplus_cjo_sampleTestFile.pdf] > at > org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy.commit(GenericFileDeleteProcessStrategy.java:82)[camel-core-2.10.0.jar:2.10.0] > at > org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:132)[camel-core-2.10.0.jar:2.10.0] > at > org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:82)[camel-core-2.10.0.jar:2.10.0] > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Cannot-delete-file-GenericFile-tp5719059.html > Sent from the Camel Development mailing list archive at Nabble.com. -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen