You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "cedr.f" <ce...@lampiris.be> on 2016/08/12 11:48:13 UTC

Jackson annotations ignored

Hello,

I'm using camel 2.16.3 in karaf 4.0.3, and there is a strange behaviour when
camel marshals my object into json with jackson.
All my annotations (@JsonIgnore, @JsonAnyGetter, ...) are ignored when
running through camel/karaf.
However, if i run a simple unit test with the same dependencies and try to
marshal my object to json with ObjectMapper, the output is ok ! I'm quite
sure though that they use the same library (fasterxml 2.6.3) as i go through
the same classes when debugging both the unit test and my program.

Any idea how this could be ? My camel config is really straight-forward,
nothing fancy here...

restConfiguration()
                .bindingMode(RestBindingMode.json)

This doesn't help either :
.marshal().json(JsonLibrary.Jackson)

The json is ok but it doesn't introspect my annotations.

Kind Regards,
Cédric.



--
View this message in context: http://camel.465427.n5.nabble.com/Jackson-annotations-ignored-tp5786355.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Jackson annotations ignored

Posted by Vitalii Tymchyshyn <vi...@tym.im>.
Are you sure it's proper Jackson version? Jackson vs Jackson2 have
different packages, but same annotation names.

Best regards, Vitalii Tymchyshyn

Нд, 14 серп. 2016 12:30 користувач cedr.f <ce...@lampiris.be>
пише:

> Hello,
>
> I'm using camel 2.16.3 in karaf 4.0.3, and there is a strange behaviour
> when
> camel marshals my object into json with jackson.
> All my annotations (@JsonIgnore, @JsonAnyGetter, ...) are ignored when
> running through camel/karaf.
> However, if i run a simple unit test with the same dependencies and try to
> marshal my object to json with ObjectMapper, the output is ok ! I'm quite
> sure though that they use the same library (fasterxml 2.6.3) as i go
> through
> the same classes when debugging both the unit test and my program.
>
> Any idea how this could be ? My camel config is really straight-forward,
> nothing fancy here...
>
> restConfiguration()
>                 .bindingMode(RestBindingMode.json)
>
> This doesn't help either :
> .marshal().json(JsonLibrary.Jackson)
>
> The json is ok but it doesn't introspect my annotations.
>
> Kind Regards,
> Cédric.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Jackson-annotations-ignored-tp5786355.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>