camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sumatheja <sumath...@gmail.com>
Subject need help on reading csv using camel bindy
Date Mon, 13 Jun 2011 15:07:55 GMT
Hi,
    I'm using camel bindy to read a csv file. I have a java bean declared
with fields corresponding to each csv value (using @Datafield ). However
when i have lesser fields in csv than the fields specified in bean i get the
following error:

java.lang.IllegalArgumentException: Some fields are missing (optional or
mandatory), line : 1
	at
org.apache.camel.dataformat.bindy.BindyCsvFactory.bind(BindyCsvFactory.java:218)
	at
org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.unmarshal(BindyCsvDataFormat.java:169)
	at
org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:56)
	at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
	at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
	at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)
	at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)
	at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:125)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
	at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:139)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
	at
org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:61)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
	at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:104)
	at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:272)
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:98)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
	at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
	at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
	at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)
	at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)
	at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:109)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
	at
org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:582)
	at
org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:511)
	at
org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:211)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
	at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
	at
org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)
	at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:109)
	at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
	at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
	at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
	at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:330)
	at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:157)
	at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:121)
	at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:97)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
	at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)


 Is there a way to set a default value to fields if they dont come in csv as
in the case where the no. of values in csv may be varying within a limit.

thanks in advance

--
View this message in context: http://camel.465427.n5.nabble.com/need-help-on-reading-csv-using-camel-bindy-tp4484676p4484676.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message