[Jersey] Re: nil instead of null

From: nbaliga <>
Date: Mon, 26 Sep 2011 07:14:48 -0700 (PDT)

I did try using the 1.9 SNAPSHOT in my efforts to incorporate a Jackson
provider in my Jersey project.

However, and I double checked this morning, the root unwrapping feature
doesn't work for me. I still get the Java name of the root variable instead
of the XmlRootElement name attribute value.

I think this is a side effect of the fact that Jackson seems to be ignoring
the JAXB annotations altogether, because the propOrder of the elements is
also being ignored.

Here are the options I'm configuring my ObjectMapper with:
      objectMapper = new ObjectMapper();

      objectMapper.configure( SerializationConfig.Feature.WRAP_ROOT_VALUE,
true );

      objectMapper.configure( SerializationConfig.Feature.INDENT_OUTPUT,
false );

      objectMapper.configure( SerializationConfig.Feature.USE_ANNOTATIONS,
true );

JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS, false );

      objectMapper.configure( DeserializationConfig.Feature.USE_ANNOTATIONS,
true );

      final AnnotationIntrospector introspector = new

      // make serializer use JAXB annotations (only)
introspector );

      // make deserializer use JAXB annotations (only)
introspector );

I toggled the INDENT_OUTPUT option to ensure that Jersey is indeed using the
ObjectMapper instance that I am providing, and sure enough the output
changed according to what I set this feature to.

I am using Jersey 1.5 btw.

View this message in context:
Sent from the Jersey mailing list archive at