The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

newbie000 (10) [Avatar] Offline
#1
I tried to run "FileSaverWithFileName.java" example from "camelinaction-source-280camelinaction-sourcechapter7filesrcmainjavacamelinaction" but it throws the following exception. Can somebody comments why the exception is thrown?


component.file.GenericFileOperationFailedException: Cannot store file: targetdataoutbox20111002-10:39:49.txt
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot store file: targetdataoutbox20111002-10:39:49.txt
at org.apache.camel.component.file.FileOperations.storeFile(FileOperations.java:212)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:254)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:156)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.component.file.GenericFileProducer.process(GenericFileProducer.java:80)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:7smilie[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:114)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:286)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:109)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:7smilie[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:9smilie[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:7smilie[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:31smilie[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:209)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:305)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:102)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:7smilie[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:9smilie[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:69)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:104)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)[camel-core-2.8.0.jar:2.8.0]
at org.apache.camel.component.stream.StreamConsumer.processLine(StreamConsumer.java:187)[camel-stream-2.8.0.jar:2.8.0]
at org.apache.camel.component.stream.StreamConsumer.readFromStream(StreamConsumer.java:14smilie[camel-stream-2.8.0.jar:2.8.0]
at org.apache.camel.component.stream.StreamConsumer.run(StreamConsumer.java:94)[camel-stream-2.8.0.jar:2.8.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_26]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:90smilie[:1.6.0_26]
at java.lang.Thread.run(Thread.java:662)[:1.6.0_26]
davsclaus (413) [Avatar] Offline
#2
Re: Exception when ran an example from Chapter 7
What OS are you using?
newbie000 (10) [Avatar] Offline
#3
Re: Exception when ran an example from Chapter 7
I'm using Windows XP
JAVA 6
davsclaus (413) [Avatar] Offline
#4
Re: Exception when ran an example from Chapter 7
Thanks for reporting. Will get this fixed for the next release.
davsclaus (413) [Avatar] Offline
#5
Re: Exception when ran an example from Chapter 7
The fix is to remove the colons in the following line as shown in the patch below:

- .to("file:target/data/outbox?fileName=${date:now:yyyyMMdd-hh:mm:ss}.txt");
+ .to("file:target/data/outbox?fileName=${date:now:yyyyMMdd-hhmmss}.txt");