You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by fxthomas <fe...@gmail.com> on 2015/07/15 11:07:55 UTC
Cannot store file error CSV
hello,
I am trying to write from a DB to CSV file , and I always get a cannot
store file exception. My route is like below
from("timer://getData?period=2h").setBody(constant("SQL
Query")).to("jdbc:DS?outputType=StreamList").split(body()).to(file://C:\\GitWrk?fileName=data.csv&fileExist=Append);
I am writing to my local disk ,so I have full permission rights too. I
tried without and with split too but same error.
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
store file: C:\GitWrK\data.csv
at
org.apache.camel.component.file.FileOperations.storeFile(FileOperations.java:292)[camel-core-2.15.1.jar:2.15.1]
at
org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:277)[camel-core-2.15.1.jar:2.15.1]
at
org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:165)[camel-core-2.15.1.jar:2.15.1]
at
org.apache.camel.component.file.GenericFileProducer.process(GenericFileProducer.java:79)[camel-core-2.15.1.jar:2.15.1]
at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[camel-core-2.15.1.jar:2.15.1]
at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129)[camel-core-2.15.1.jar:2.15.1]
Any Pointers ?
Regards,
Felix
--
View this message in context: http://camel.465427.n5.nabble.com/Cannot-store-file-error-CSV-tp5769339.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Cannot store file error CSV
Posted by fxthomas <fe...@gmail.com>.
okay, I will try that.
I had tried without existing file and without existing file , in both cases
it gave the same issue.
--
View this message in context: http://camel.465427.n5.nabble.com/Cannot-store-file-error-CSV-tp5769339p5769441.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Cannot store file error CSV
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Can you try without the jdbc and splitter etc. So its just from timer
-> setBody -> to file to see if it stores a file. Also test situations
there there is no existing file, and maybe there is an existing file
to see if the append works.
On Thu, Jul 16, 2015 at 1:08 PM, Greg Autric <ga...@redhat.com> wrote:
> Hi fxthomas,
>
> If your stacktrace is up to date.
> You have got an InvalidPayloadException
> the payload could be null or use the wrong class type, etc.
>
> https://github.com/apache/camel/blob/b378bcdedfbd0ac375d052ca4dccdbad6bed1ce9/camel-core/src/main/java/org/apache/camel/component/file/FileOperations.java#L292
>
> an other idea, it could be to convert to a String the payload before write it into the file,
> you have to check what is the output payload of sql component
>
> Greg AUTRIC
> JBoss Middleware Consultant
>
> email : gautric __at__ redhat __dot__ com
> twitter : @gautric_io
>
> Red Hat Global Services
> Red Hat France SARL sit: http://www.redhat.fr
> Le Linea, 1 rue du General Leclerc, 92047 Paris La Défense Cedex
> Sent from webmail
>
> ----- Mail original -----
> De: "fxthomas" <fe...@gmail.com>
> À: users@camel.apache.org
> Envoyé: Mercredi 15 Juillet 2015 11:07:55
> Objet: Cannot store file error CSV
>
> hello,
>
> I am trying to write from a DB to CSV file , and I always get a cannot
> store file exception. My route is like below
>
> from("timer://getData?period=2h").setBody(constant("SQL
> Query")).to("jdbc:DS?outputType=StreamList").split(body()).to(file://C:\\GitWrk?fileName=data.csv&fileExist=Append);
>
> I am writing to my local disk ,so I have full permission rights too. I
> tried without and with split too but same error.
>
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
> store file: C:\GitWrK\data.csv
> at
> org.apache.camel.component.file.FileOperations.storeFile(FileOperations.java:292)[camel-core-2.15.1.jar:2.15.1]
> at
> org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:277)[camel-core-2.15.1.jar:2.15.1]
> at
> org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:165)[camel-core-2.15.1.jar:2.15.1]
> at
> org.apache.camel.component.file.GenericFileProducer.process(GenericFileProducer.java:79)[camel-core-2.15.1.jar:2.15.1]
> at
> org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[camel-core-2.15.1.jar:2.15.1]
> at
> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129)[camel-core-2.15.1.jar:2.15.1]
>
> Any Pointers ?
>
> Regards,
> Felix
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Cannot-store-file-error-CSV-tp5769339.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition: http://www.manning.com/ibsen2
Re: Cannot store file error CSV
Posted by Greg Autric <ga...@redhat.com>.
Hi fxthomas,
If your stacktrace is up to date.
You have got an InvalidPayloadException
the payload could be null or use the wrong class type, etc.
https://github.com/apache/camel/blob/b378bcdedfbd0ac375d052ca4dccdbad6bed1ce9/camel-core/src/main/java/org/apache/camel/component/file/FileOperations.java#L292
an other idea, it could be to convert to a String the payload before write it into the file,
you have to check what is the output payload of sql component
Greg AUTRIC
JBoss Middleware Consultant
email : gautric __at__ redhat __dot__ com
twitter : @gautric_io
Red Hat Global Services
Red Hat France SARL sit: http://www.redhat.fr
Le Linea, 1 rue du General Leclerc, 92047 Paris La Défense Cedex
Sent from webmail
----- Mail original -----
De: "fxthomas" <fe...@gmail.com>
À: users@camel.apache.org
Envoyé: Mercredi 15 Juillet 2015 11:07:55
Objet: Cannot store file error CSV
hello,
I am trying to write from a DB to CSV file , and I always get a cannot
store file exception. My route is like below
from("timer://getData?period=2h").setBody(constant("SQL
Query")).to("jdbc:DS?outputType=StreamList").split(body()).to(file://C:\\GitWrk?fileName=data.csv&fileExist=Append);
I am writing to my local disk ,so I have full permission rights too. I
tried without and with split too but same error.
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
store file: C:\GitWrK\data.csv
at
org.apache.camel.component.file.FileOperations.storeFile(FileOperations.java:292)[camel-core-2.15.1.jar:2.15.1]
at
org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:277)[camel-core-2.15.1.jar:2.15.1]
at
org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:165)[camel-core-2.15.1.jar:2.15.1]
at
org.apache.camel.component.file.GenericFileProducer.process(GenericFileProducer.java:79)[camel-core-2.15.1.jar:2.15.1]
at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[camel-core-2.15.1.jar:2.15.1]
at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129)[camel-core-2.15.1.jar:2.15.1]
Any Pointers ?
Regards,
Felix
--
View this message in context: http://camel.465427.n5.nabble.com/Cannot-store-file-error-CSV-tp5769339.html
Sent from the Camel - Users mailing list archive at Nabble.com.