users@jersey.java.net

Re: [Jersey] Choosing a Provider for a MediaType in Ambiguous Conditions

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 08 Apr 2009 16:31:51 +0200

On Apr 8, 2009, at 4:24 PM, Stephen Duncan Jr wrote:

> On Tue, Apr 7, 2009 at 4:22 AM, Paul Sandoz <Paul.Sandoz_at_sun.com>
> wrote:
> Hi Stephen,
>
> This is a known issue in JAX-RS.
>
> I think there is a way to fix this in Jersey by sorting the message
> body readers/writers such that readers/writers with the most
> specific generic type occur first and thus the isWriteable/
> isReadable if the more specifc generic types are called first. (Such
> general sorting is non-trivial for complex types, and there may be
> more than one solution, but for Class types it is easy).
>
> Thus readers/writers for String or StreamOutput would occur before
> Object (which is what the Jackson JSON readers/writers support).
>
> Could you log an issue?
>
> Thanks,
> Paul.
>
> On Apr 7, 2009, at 3:57 AM, Stephen Duncan Jr wrote:
>
> Logged as Issue 261: https://jersey.dev.java.net/issues/show_bug.cgi?id=261
>

Thanks! This will be fixed as part of the 1.1 integration work which
will occur very soon.

Paul.