Skip to content

Jersey 4: Support for Jackson 3 ? #6036

Description

@jolarsen

Hi Jersey maintainers,

I am looking into upgrading our projects to use Jackson 3. After doing most of the migration, I am left with our custom ContextResolver: Jersey 4 seems to expect com.fasterxml.jackson and does not pick up a ContextResolver for tools.jackson.databind.ObjectMapper (or tools.jackson.databind.json.JsonMapper - which is our choice for Jackson 3))

What are the plans for supporting Jackson 3?

Our current ContextResolver<Jackson 2.20 ObjectMapper> works well with Jersey 4, so no hurry. But we would eventually want one, global Jackson 3 JsonMapper.

Thanks for all your great work!

Activity

  1. arjantijms commented on Nov 16, 2025

    @arjantijms
    Contributor

    Hi Jersey maintainers,

    There aren't many maintainers left, unfortunately. We're looking for new commiters, so if this is something you can and would like to work on, that would be awesome. Let me know if you're interested.

  2. jolarsen commented on Nov 16, 2025

    @jolarsen
    Author

    I'll have some more time available towards the end of the year and next year. I was at Sun Micro (com.sun.hadb) when GlassFish started some 20 years ago - I don't remember if we switched to org.glassfish.hadb back then in 2005.
    But first: What's the story with jersey-media-json-jackson and jackson-jaxrs-json-provider ? The code seems a bit "related"
    We have been using jersey-media-json-jackson - we should probably try out tools.jackson.jaxrs:jackson-jaxrs-json-provider. Then, there is the question if Jersey should provide a jersey-media-json-jackson3 or delegate to jackson-jaxrs-json-provider

  3. arjantijms commented on Nov 16, 2025

    @arjantijms
    Contributor

    I was at Sun Micro (com.sun.hadb) when GlassFish started some 20 years ago - I don't remember if we switched to org.glassfish.hadb back then in 2005.

    Oh wow, that was some time ago for sure.

    But first: What's the story with jersey-media-json-jackson and jackson-jaxrs-json-provider ?

    To be honest, I don't know. I'm a committer on this project, but admittedly not a very active committer. With all the others more or less gone (although they could still contribute in their own time), we'll have to see how we can still move things forward.

  4. jansupol commented on Nov 16, 2025

    @jansupol
    Contributor

    Jersey repackages jackson-jaxrs-json-provider and jackson-jaxrs-base so that jersey-media-json-jackson uses the version that is tested with Jersey module, and the customer can still be using a different version of Jackson.

  5. jansupol commented on Nov 16, 2025

    @jansupol
    Contributor

    These two are in the https://github.com/eclipse-ee4j/jersey/tree/2.x/media/json-jackson/src/main/java/org/glassfish/jersey/jackson/internal/jackson/jaxrs - the prefix from package com.fasterxml.jackson.jaxrs is moved to org.glassfish.jersey.jackson.internal.jackson.jaxrs. The license of Jackson remains.

  6. jansupol commented on Nov 16, 2025

    @jansupol
    Contributor

    if Jersey should provide a jersey-media-json-jackson3 or delegate to jackson-jaxrs-json-provider

    Jackson is not famous for keeping backwards compatibility. I would be worried about whether both the jackson2 and jackson3 modules would be working with the same Jersey configuration code. So I think the new module would be the better choice.

  7. jolarsen commented on Jan 2, 2026

    @jolarsen
    Author

    Hi, I have made an attempt at a new module json-jackson3 based on the pattern from media/json-jackson and tools.jackson - In all 81 files (including example and tests).
    This works well with a larger project I am developing/maintaining - just built jersey locally, dropped in json-jackson3, changed the ContextResolver to JsonMapper/Jackson3 and voila.

    The main changes were due to immutable ObjectMappers and maxStringLength + modules enabled/disabled - so DefaultJacksonJaxbJsonProvider and JacksonMapperConfigurator look a bit different.
    But I wonder if MessageProperties.JSON_MAX_STRING_LENGTH is needed - so we could avoid changing StreamReadConstraings.

    I started off from the 4.0.0-BRANCH. How can we proceed from here? Should I send you a patch for review or create a PR ?

  8. jolarsen commented on Jan 6, 2026

    @jolarsen
    Author

    @jansupol / @arjantijms I have a proposal for json-jackson3 ready locally and can create a PR for further discussion.
    Which branch is best suited ? 4.0.0-BRANCH or 4.0 ?

  9. jansupol commented on Jan 8, 2026

    @jansupol
    Contributor

    Current flow is 4.0 -> 4.0.JPMS -> release.

  10. jolarsen commented on Jan 11, 2026

    @jolarsen
    Author

    I have created PR 6048. I have tested the basics in the code and with other projects - works OK. Least confident about Filtering

  11. linked a pull request that will close this issueIssue 6036: Support for Jackson3 #6048on Jan 13, 2026
  12. added theissue type on Feb 27, 2026
  13. added this to the 4.0.3 milestone on Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions