Jackson Provider no longer working in 7.0.3 - was working in 7.0.2...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Jackson Provider no longer working in 7.0.3 - was working in 7.0.2...

Pachler, Uwe
Hello,

My application uses Jackson as JSON provider, by adding jackson-jaxrs-json-provider as a dependency. (jackson-jaxrs-json-provider defines a @Provider-annotated JacksonJaxbJsonProvider, implementing MessageBodyReader and MessageBodyWriter).

The application works fine in TomEE 7.0.2, using Jackson to serialize and deserialize JSON. But in 7.0.3, Jackson is no longer recognized; instead, it appears that the TomEE-provided johnzon library is now preferred instead (which breaks serialization in my app, as it produces different output).

Any idea of what can cause this?


Kind Regards,

Uwe Pachler
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Jackson Provider no longer working in 7.0.3 - was working in 7.0.2...

Romain Manni-Bucau
Hi Uwe,

yes, this is a know bug of jackson library. Jackson uses */* as mediatype
but jaxrs sorting mandates to sort by priority using wildcard as the least
prioritize so johnzon is higher priority cause it uses application/json.
Just extends JacksonJaxbJsonProvider in a custom @Provider using
@Consumes/@Produces("application/json") and it will work since johnzon is
set as the least prioritized application/json to support to be overrided by
the users.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2017-06-13 17:55 GMT+02:00 Pachler, Uwe <[hidden email]>:

> Hello,
>
> My application uses Jackson as JSON provider, by adding
> jackson-jaxrs-json-provider as a dependency. (jackson-jaxrs-json-provider
> defines a @Provider-annotated JacksonJaxbJsonProvider, implementing
> MessageBodyReader and MessageBodyWriter).
>
> The application works fine in TomEE 7.0.2, using Jackson to serialize and
> deserialize JSON. But in 7.0.3, Jackson is no longer recognized; instead,
> it appears that the TomEE-provided johnzon library is now preferred instead
> (which breaks serialization in my app, as it produces different output).
>
> Any idea of what can cause this?
>
>
> Kind Regards,
>
> Uwe Pachler
>
Loading...