NoSuchMethodError on JSR310DateTimeDeserializerBase.findFormatOverride -- checked for version incompatibilities
See original GitHub issueI installed the JSR310 datatype package by adding the below to my build.gradle
.
compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.9.5'
Once I did so, I started getting the following error on every POST
endpoint on my spring-webmvc
application:
Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: 'com.fasterxml.jackson.annotation.JsonFormat$Value com.fasterxml.jackson.datatype.jsr310.deser.JSR310DateTimeDeserializerBase.findFormatOverrides(com.fasterxml.jackson.databind.DeserializationContext, com.fasterxml.jackson.databind.BeanProperty, java.lang.Class)'
I followed the advice I found here to remove incompatible extra versions of jackson
on my classpath, which I did – I had 2.11.2
installed as well. I removed it, and when this problem persisted, I grep
ed my home folder and removed every trace of that version I could find (from ~/.m2
, ~/.gradle/caches
, and my tomcat
installation). Despite that, I’m still getting the same error. I also tried both downgrading and upgrading from 2.9.5
to 2.8.9
and 2.11.2
, cleaning out all traces of other versions of the package each time.
When I run ./gradlew dependencies | grep jackson
, all versions of Jackson-related packages are between 2.9.0
and 2.9.5
.
Any idea what’s going on here? I’ve been trying to figure this out for more than a day, and I’m not sure what to try next. Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
I found the issue (although I haven’t figured out how to fix it)…there’s a local jar that I’m including that has
jackson-databind:2.6.7
in it. When I switched tojackson-databind:2.9.10
, per @cowtowncoder’s suggestion, I got a new (but similar) error:In the process of trying to track that down, I discovered there were two
JsonGenerator
classes on my classpath, and the older one was inside that local jar.For anyone else who runs into this issue – you can’t resolve it in the
build.gradle
orpom.xml
files of the project from which you’re requiring the local jar. You have to exclude the old dependency from thebuild.gradle
orpom.xml
file of the package that you built the local jar from. Here’s what I mean:I tried to remove the older version of
jackson-databind
by adding something like this to my primarybuild.gradle
:That didn’t work. What worked was excluding the old version of
jackson-databind
from the originalpom.xml
for the local jar I was using. In my case, that looked like this:Then I rebuilt the local jar with
mvn package
, and referenced that new jar from mybuild.gradle
.Thank you @cowtowncoder and @kupci for your help!
@jlevers glad you were able to solve the issue, and thank you very much for documenting it to help others!