You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Gunjara <mg...@gmail.com> on 2016/11/25 02:25:42 UTC

nullpointerException coming while doing JSON to Java POJO

HI can any body help me on this.
    from("direct:restClient").toD("url")
	        .unmarshal().json(JsonLibrary.Jackson, Product[].class
).log("STARTED!")
	   
		    .process(new 
		    		Processor() { 
		    	@Override 
		    	public void process(Exchange exchange) throws Exception { 
		    	Product body = exchange.getIn().getBody(Product.class); 
		    	exchange.getIn().setBody(body);
		    	}})
		 .end(); 



	



--
View this message in context: http://camel.465427.n5.nabble.com/nullpointerException-coming-while-doing-JSON-to-Java-POJO-tp5790508.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: nullpointerException coming while doing JSON to Java POJO

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Sorry but you need to provide more detailed information before we can help you.

Where do you get the NPE, and what versions are you using. And how do
you run this etc.

I suggest to dive deeper yourself a bit more before reaching back to us.

On Fri, Nov 25, 2016 at 3:25 AM, Gunjara <mg...@gmail.com> wrote:
> HI can any body help me on this.
>     from("direct:restClient").toD("url")
>                 .unmarshal().json(JsonLibrary.Jackson, Product[].class
> ).log("STARTED!")
>
>                     .process(new
>                                 Processor() {
>                         @Override
>                         public void process(Exchange exchange) throws Exception {
>                         Product body = exchange.getIn().getBody(Product.class);
>                         exchange.getIn().setBody(body);
>                         }})
>                  .end();
>
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/nullpointerException-coming-while-doing-JSON-to-Java-POJO-tp5790508.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2