Hello,

I setup the camel routes shown below:
In stage folder i can see message getting marshal properly into a json.
but while un-marshaling on this line body.setA("modified A");
i get a null pointer exception basically body is null.. *Why* ?

StackOverflow question link:
http://stackoverflow.com/questions/33058563/adding-a-processor-after-unmarshaling-in-apache-camel

from("direct:stage").marshal().json(JsonLibrary.Gson).to("file://stage");

from("file://stage").unmarshal().json(JsonLibrary.Gson).process(new
Processor() {
    @Override
    public void process(Exchange exchange) throws Exception {
        MyTest body = exchange.getIn().getBody(MyTest.class);
        body.setA("modified A");
    }}).to("direct:b");

Reply via email to