Jackson & Jettison usage in Jersey

manikanta picture manikanta · Aug 30, 2011 · Viewed 9k times · Source

Jersey framework uses both Jackson and Jettison libraries for JSON unmarshalling/marshalling. AFAIK, Jettison is for for mapping JSON to XML (with different mechanism support like mapped notation) and Jackson is for JSON generation/parsing (I'm using this without Jersey also).

Will Jersey using these two for two different functionalities or both for same JSON generation/parsing functionality?

I only want support JSON format. At my first thought, it seems I can remove either of the dependencies and I think I can remove Jettison as Jacksone seems more natural choice for JSON generation/parsing.

Answer

StaxMan picture StaxMan · Aug 31, 2011

Jersey will use one or the other, not both, for all JSON processing. Recommendation as far as I know is to use Jackson; Jettison support is older and was implemented before Jackson became available. Jettison is still supported for compatibility reasons but unless some code relies on exact structure it produces (which differs from straight-forward mapping) there's little benefit from using it.