Hi all,
I'm starting to use Camel and I'm trying to use Bindy to read a CSV File.
I'm getting the error:
java.lang.IllegalArgumentException: The separator has not been defined in
the annotation @CsvRecord or not instantiated during initModel. must be
specified
at org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:290)
at
org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.unmarshal(BindyCsvDataFormat.java:124)
at
org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:57)
Here is a very simple test:
from("direct:start").marshal().bindy(BindyType.Csv,
"services.billing").to("direct:middle");
from("direct:middle").unmarshal(new
BindyCsvDataFormat("services.billing.MyBillingItem")).to("direct:test");
And to test, something like this:
MyBillingItem bill = new MyBillingItem();
CamelContext ctx = CamelPlugin.getCamelContext();
bill.id= 1;
bill.number = "1234;
ctx.createProducerTemplate().sendBody("direct:start", bill);
On MyBillingItem.class, I have set the annotations:
...
@CsvRecord(separator = ",", quote = "\"", skipFirstLine = true)
public class MyBillingItem {
...
If I'm doing something wrong, please advice.
Thanks
PS. I need to use 2.10.0 because of some features.
--
View this message in context:
http://camel.465427.n5.nabble.com/Camel-2-10-0-and-Bindy-CSV-tp5715387.html
Sent from the Camel - Users mailing list archive at Nabble.com.