Could you please help me with these 2 queries/Issues :
Can anyone who has worked on Jackson 2.9.2 ,let me know what is the compatible Jersey version for Jackson 2.9.2.I am currently using Jersey 2.23.2 but it does not work with Jackson 2.9.2.I get following error :
[ERROR ] SRVE0777E: Exception thrown by application class 'org.glassfish.jersey.servlet.WebComponent.serviceImpl:489'
javax.servlet.ServletException: org.glassfish.jersey.server.ContainerException: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.util.BeanUtil.okNameForSetter(Lcom/fasterxml/jackson/databind/introspect/AnnotatedMethod;)Ljava/lang/String;
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:489)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:427)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:388)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:341)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:228)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1290)
2) In general ,is there some way to find combination of Jars.I have faced this issue earlier also while finding right combination of Jersey and Spring jars.It will save my and other's facing same issue lot of time,if someone can guide on this.
Thanks.
As of mid November 2017, the most recent version of Jersey is 2.26.
Jersey supports Jackson via the jersey-media-json-jackson
extension module, which is released under the same version number as Jersey core modules. This extension module contains the auto-discoverable JacksonFeature
that registers the JacksonJsonProvider
class for binding JSON to Java objects.
In the version 2.26, this extension depends on Jackson 2.8.4. While in the version 2.23.2, it depends on Jackson 2.5.4.
The BeanUtil.okNameForSetter(Annotated Method)
method was deprecated in Jackson 2.5 and has been removed in Jackson 2.9.
To support the most recent version of Jackson, you could get rid of the jersey-media-json-jackson
extension module.
Then add the jackson-jaxrs-json-provider
module to your project and register the JacksonJsonProvider
directly in your ResourceConfig
or Application
implementation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With