users@jersey.java.net

[Jersey] Re: JsonSerialize.Inclusion.NON_NULL stopped working after upgrading Jersey from 2.7 to 2.17

From: Michal Gajdos <michal.gajdos_at_oracle.com>
Date: Wed, 18 Mar 2015 09:33:07 +0100

Hi Pritam,

jersey-json-jackson module now uses Jackson 2.x instead of Jackson 1.x (which was in Jersey 2.7). If you want to stick with Jackson 1.x use jersey-json-jackson1 module otherwise check packages of Jackson classes (e.g. JsonSerialize). Jackson 1.x and Jackson 2.x use different packages which may cause your issues.

Jackson 1.x package prefix - org.codehaus.jackson
Jackson 2.x package prefix - com.fasterxml.jackson

HTH,
Michal

> On 18 Mar, 2015, at 02:02 , Pritam Moodbidri <pritam_at_yahoo-inc.com> wrote:
>
> Hi,
>
>
>
> I just upgraded my Java project's jersey version from 2.7 to 2.17. This broke the use of
>
> @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
>
> And sending in Null values when the Object is serialized. Is there something missing?
>
> - Pritam
>
>