In all examples I see over the internet, need to call "setContext". but this function doesn't exist in JaxbDataFormat . Any idea or alternative way yo convert from xml to Json
// XML Data Format
JaxbDataFormat xmlDataFormat = new JaxbDataFormat();
JAXBContext con = JAXBContext.newInstance(Employee.class);
**xmlDataFormat.setContext(con);**
// JSON Data Format
JacksonDataFormat jsonDataFormat = new JacksonDataFormat(Employee.class);
from("file:C:/inputFolder").doTry().unmarshal(xmlDataFormat).
process(new MyProcessor()).marshal(jsonDataFormat).
to("jms:queue:javainuse").doCatch(Exception.class).process(new Processor() {
public void process(Exchange exchange) throws Exception {
Exception cause = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class);
System.out.println(cause);
}
});
Thanks!