Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for jackson-jakarta-rs-json-provider (Jackson 2.13) #4891

Closed
metaxmx opened this issue Oct 7, 2021 · 4 comments · Fixed by #4963
Closed

Support for jackson-jakarta-rs-json-provider (Jackson 2.13) #4891

metaxmx opened this issue Oct 7, 2021 · 4 comments · Fixed by #4963

Comments

@metaxmx
Copy link

metaxmx commented Oct 7, 2021

Since the recently released version 2.13 of Jackson there is a new module jackson-jakarta-rs-json-provider, which is the Jakarta-replacement of jackson-jaxrs-json-provider (using the jakarta instead of the deprecated javax namespace).
However, the Jersey module jersey-media-json-jackson still uses only the jackson-jaxrs-json-provider module and is not compatible to the new Jackson module due to changed packages and class names.

Would you kindly provide a way to use the new Jackson version with Jakarta-XmlBind together with Jersey.

Note: there is already a ticket in the Jackson repository concerning this issue: FasterXML/jackson-modules-base#153

@chris21k
Copy link

My project suffers from exactly the same thing. It would be nice to have a fix. Thanks.

Chris

@jansupol jansupol added this to ToDo in Jersey 3.1.0 Oct 11, 2021
@arjantijms
Copy link
Contributor

Big plus one for this, I could give it a shot. Maybe I need some help from @jansupol.

@jansupol
Copy link
Contributor

jansupol commented Jan 11, 2022

There are some pitfalls when using JAX-B 3/4 (jackson-module-jakarta-xmlbind-annotations) with Jackson module regarding compatibility.

  1. What we probably want is to support only one version of JAX-B, that is JAX-B 3/4.
  2. At the same time, we want to support older applications that used to work well with JAX-B 2 (jackson-module-jaxb-annotations). and we want these apps to keep working when using the new Jersey.

One option is to have multiple modules, 0ne for JAX-B 2, one for JAX-B 3. That seems to have a bunch of disadvantages (code duplication, module naming, maintenance...).
A better option is to support both JAX-B 2 and JAX-B 3 at the same time by a single module. That seems to be possible by making dependency on JAX-B 2 optional. That way, the existing application contains the JAX-B 2 dependency and will keep working.

At the same time, we do not want to have the dependency on JAX-B 3 optional. We want to have the Jackson module bring over the required dependencies. The required dependency would be jackson-module-jakarta-xmlbind-annotations. This requirement breaks the existing applications. However, adding the required dependency would be enough, and we consider it the best option.

The proposal is #4963.

@jansupol jansupol linked a pull request Jan 11, 2022 that will close this issue
@jansupol jansupol moved this from ToDo to InProgress in Jersey 3.1.0 Jan 11, 2022
@jansupol jansupol moved this from InProgress to Done in Jersey 3.1.0 May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

4 participants