-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Issue with JacksonFeature and osgi #4554
Comments
There seems to be some missing dependency, Jersey depends on
but your settings seem to be complaining about
Does it work when you keep Jackson 2.11.0? |
I had the same problem. It turns out that version 2.31 needs a new resource file, META-INF/services/com.fasterxml.jackson.databind.Module supplied by jackson-module-jaxb-annotations/2.10.2 So switching classloader to one that can find the file before registering the servlet solved it for me:
Hope that helps. |
I am running into this exact same issue with Jersey Client (Was upgrading from Jersey 1.x to 2.34). Is there any more information on fixing this? I have tried working with Jackson 2.11.0 and no dice there.
`1. java.util.ServiceConfigurationError: com.fasterxml.jackson.databind.Module: Provider com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule not found
|
@ICTKevinWong do you run this in osgi environement? In which if so? basically there should be a dependency for
but if you are running this in an OSGi env, there could be missing bundle like:
|
I am running this as a vCenter plugin which I believe is a Virgo Server Bundle Structure of the failure
Embedded-Artifacts Snippet in Manifest
|
@ICTKevinWong thanks for reporting those dependencies.
from the dependencies list I see you have all jackson-* related dependencies, but I'm not able to find jaxb-api dependency there. Please check if jaxb-api is included as well. |
No dice. I might be mistaken, but I believe that jakarta.xml.bind-api-2.3.2.jar is the Eclipse Jaxb-api and should satisfy the requirements. I think there are some issues that I need to work out with VMware as this bundle works with the latest vCenter version and not previous versions. For the time being I will use Jersey 2.34 and tag jersey-media-json-jackson to 2.30.1. It's likely some sort of dependency collision with the app server For future reference, I understand that I sort of hijacked this issue; would it have been better to create a new issue and reference this thread? |
you mean for that combination it works for you?
yes, my bad, I've missed that. It perfectly works for jackson-module-jaxb-annotations. regarding new issue - I think we can keep going here, since we've already discussed a lot and the issue is relevant - you are running the code in osgi environment. |
Yes, mixing versions seems to work fine with jersey client. A little bit more information that may be helpful. I've been playing with mixing versions and the following POM and Jar bundle functionally works. We can use the 2.34 and Jackson 2.12.3 as long as Jersey-media-json-jackson is 2.30.1 ...
|
A proper Jakarta edition of JacksonFeature which uses the Jackson module "jackson-jakarta-rs-json-provider" instead of "jackson-module-jaxb-annotations" should be implemented. |
@JensGabe your comment probably does not relate to this OSGi issue. Latest Jersey 3.x already implements the dependency on |
Found #4891 which regards Jackson 2.13, but the implementation seems a bit odd, as the code now contains references to both mentioned jackson modules? |
The reference to the javax modules is optional. It is there for backward compatibility, should someone use the module with both JAX-B/2 (javax) and JAX-B/3 (jakarta). Using two modules is an option, but it leads to code duplication and many modules for Jackson. I believe Jackson will come with the support of JAX-B/4 (EE10), which would have been another module. |
Ahh, I do not need the jackson-module-jaxb-annotations anymore, only the jackson-module-jakarta-xmlbind-annotations - thanks |
Hi,
I'm not sure if this is a bug or I configured something wrong ?
I use jersey in an osgi (karaf 4.2.9) environment with java 8.
I updated jersey from 2.30.1 to 2.31 and jackson from 2.11.0 to 2.11.2.
After update we receive the following exception:
org.glassfish.hk2.api.MultiException: A MultiException has 2 exceptions. They are:
I think this depends on the feature PULL 4447
The setup looks like:
Thanks and Regards
The text was updated successfully, but these errors were encountered: