users@jersey.java.net

[Jersey] Re: Proper Configuration of Jackson 2.0 in Jersey 2.6

From: Robert DiFalco <robert.difalco_at_gmail.com>
Date: Mon, 24 Feb 2014 10:51:48 -0800

Scratch all of that, I got it to work. I had some of my configuration from
2.5 still there (when it was a lot harder) and that interfered with the new
approach in 2.6. So move along, nothing to see here. :)


On Mon, Feb 24, 2014 at 10:35 AM, Michal Gajdos <michal.gajdos_at_oracle.com>wrote:

> Hi,
>
> take a look at ContextResolvers in this sample application [1] or in this
> test [2].
>
> [1]
> https://github.com/mgajdos/jersey-param-converters/blob/master/src/main/java/sk/dejavu/blog/examples/paramconverters/provider/ObjectMapperContextResolver.java#L14
> [2]
> https://github.com/jersey/jersey/blob/master/tests/integration/jersey-2322/src/main/java/org/glassfish/jersey/tests/integration/jersey2322/MyObjectMapperProvider.java#L53
>
> Michal
>
> On 24.02.2014, 19:27 , Robert DiFalco wrote:
>
> Yeah, using the implicit Jackson providers with ContextResolver was
> supposed to be fixed in the latest Jersey release, but it does not seem to
> be and there is nothing explaining how to set it up (just out of date doc
> on the site).
>
>
> On Mon, Feb 24, 2014 at 9:27 AM, Ted M. Young [@jitterted] <
> tedyoung_at_gmail.com> wrote:
>
>> There's this JIRA that's in the backlog:
>> https://java.net/jira/browse/JERSEY-2107
>>
>> But the one I filed about the ContextResolver appears to have been
>> closed in 2.6, but I haven't tried it yet:
>> https://java.net/jira/browse/JERSEY-2322
>>
>> ;ted
>>
>>
>>
>>
>> On Mon, Feb 24, 2014 at 9:16 AM, Robert DiFalco <robert.difalco_at_gmail.com
>> > wrote:
>>
>>> I'm not really clear on the correct path to do this in 2.6. I had to go
>>> through a lot in 2.5x. Am I to understand that I know longer use
>>> JacksonFeature? That I only need to declare a ContextResolver for my
>>> ObjectMapper instance? If so this doesn't seem to be working for me. Maybe
>>> I need to register the my ContextResolver explicitly (not just annotated
>>> with Provider)? Or maybe I'm missing a dependency? I assumed I could now
>>> exclude media jackson json.
>>>
>>> The Jersey documentation is not up to date on this matter and still
>>> seems to be advising on the method used in 2.5 to configure Jackson 1.x.
>>>
>>> TIA
>>>
>>
>>
>
>