Use the data format outside the processor, so it properly gets
initialized. It would need this to work in osgi with classloading
http://camel.apache.org/data-format.html



On Tue, Apr 7, 2015 at 6:41 PM, gargankur007 <gargankur...@gmail.com> wrote:
> Hi Claus
>
> Thanks for your interest.
> Use case is "Can we use a beaniodataformat depending upon the exchange
> filetype or file extension?"
>
> Eg
> from("file://filPath")
>                                                 // do a little logging
>
>                                                 // aggregate based on header 
> correlation key
>                                                 // use class 
> MyAggregationStrategy for aggregation
>                                                 // and complete when we have 
> aggregated 14 messages
>                                                 .process(new Processor() {
>
>                                                         @Override
>                                                         public void 
> process(Exchange exchange) throws Exception {
>
>                                                                 
> System.out.println("B3");
>                                                                 final 
> DataFormat language = new BeanIODataFormat("CSVMappings.xml",
> "languageFile");
>                                                                 
> System.out.println("B2"
>                                                                               
>   + language.unmarshal(exchange,
> exchange.getIn().getBody(InputStream.class)));
>
>                                                         }
>                                                 })
>
> The above code does not work and throws runtime exceptions.
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/BeanIODataFormat-giving-exception-in-OSGI-compliant-Karaf-Server-Camel-tp5765404p5765442.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Reply via email to