users@jersey.java.net

Re: [Jersey] Help with JacksonJSONProvider and Glassfish

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 08 Mar 2010 10:45:44 +0100

On Mar 6, 2010, at 9:02 AM, John Lister wrote:

>
>
> Paul Sandoz wrote:
>> On Mar 4, 2010, at 11:07 PM, John Lister wrote:
>>> Paul Sandoz wrote:
>>>> Two other solutions:
>>>>
>>>> 1) place the names of the classes in a file META-INF/services/
>>>> jersey-server-components
>>>> that way the classes will get logged and you do not required
>>>> to know the provider interface
>>> Bizarrely, placing the provider in this file works. Which is good
>>> for me.
>> OK.
>>
>> Do you have the jersey-json stuff in your class path? If so that
>> might explain why the specific META-INF/services interfaces files
>> did not work, because the Jersey JAXB JSON providers are taking
>> precedence.
> Its running under glassfish, so all the jersey jars are presumably
> being loaded. If I use explicit reader/writer files then the jackson
> provider class is constructed, but never called.

Ah, that is explains the behavior!


> So I guess there is an order jersey uses when searching for matching
> providers.

Yes, for interface specific META-INF/service files.


> As the other way works, this isn't important and may serve as a
> reference for other people.
>

Yes.

Paul.