users@jersey.java.net

[Jersey] Migrating to Jersey 2 question

From: NBW <emailnbw_at_gmail.com>
Date: Tue, 10 Feb 2015 20:11:31 -0500

I'm in the process of migrating an application which is currently deployed
to EE6/Glassfish 3.1.2.2 and uses a simple JAXBContextResolver to provide
to contexts for JSON (de)serialization. One context uses mapped and the
other natural. The mapped context configures 'arrays' and sets root
unwrapping true. The natural context simply sets root unwrapping to true.

So far, deploying to Glassfish 4.1, I've tried both the default MOXy and
Jackson. With MOXy I set up a simple MoxyJsonConfig, created a
ContextResolver for it and registered the resolver with my Application
class. With Jackson I registered the JacksonFeature and an ObjectMapper
@Provider setting features as appeared appropriate. Neither approach was
able to generate the same JSON output as I was getting with GF 3.1.2.2 /
Jersey 1.11.

Has anyone gone down this path? Is there a simple drop in replacement for
these modes in Jersey 2 that I'm just missing?

Thanks,

-Noah