question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NoSuchMethodError on JSR310DateTimeDeserializerBase.findFormatOverride -- checked for version incompatibilities

See original GitHub issue

I 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 greped 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:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jleverscommented, Oct 26, 2020

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 to jackson-databind:2.9.10, per @cowtowncoder’s suggestion, I got a new (but similar) error:

java.lang.NoSuchMethodError: 'void com.fasterxml.jackson.core.JsonGenerator.writeStartObject(java.lang.Object)'

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 or pom.xml files of the project from which you’re requiring the local jar. You have to exclude the old dependency from the build.gradle or pom.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 primary build.gradle:

compile (files('path/to/local.jar')) {
	exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
}

That didn’t work. What worked was excluding the old version of jackson-databind from the original pom.xml for the local jar I was using. In my case, that looked like this:

<dependency>
    <groupId>com.amazonaws</groupId>
    <artifactId>aws-java-sdk-signer</artifactId>
    <version>1.11.610</version>

    <exclusions>
	<exclusion>
	    <groupId>com.fasterxml.jackson.core</groupId>
	    <artifactId>jackson-databind</artifactId>
	</exclusion>
    </exclusions>
</dependency>

Then I rebuilt the local jar with mvn package, and referenced that new jar from my build.gradle.

Thank you @cowtowncoder and @kupci for your help!

0reactions
cowtowncodercommented, Oct 26, 2020

@jlevers glad you were able to solve the issue, and thank you very much for documenting it to help others!

Read more comments on GitHub >

github_iconTop Results From Across the Web

com.fasterxml.jackson.datatype.jsr310.deser ... - Stack Overflow
NoSuchMethodError : com.fasterxml.jackson.datatype.jsr310.deser.JSR310DateTimeDeserializerBase.findFormatOverrides on Databricks.
Read more >
java.lang.NoSuchMethodError: com.fasterxml.jackson ...
I encounter the problem on MacBook but works well on Wintel. please help. My environment as below: 1. MacBook + IntelliJ + SpringMVC5.1.8...
Read more >
NoSuchMethodError in Java - Baeldung
We can check the libraries and their versions in the list generated by this command. Moreover, we can also manage dependencies using maven...
Read more >
3 Steps to Fix NoSuchMethodErrors and ...
A NoSuchMethodError occurs when we're calling a method that does not exist at runtime. The method must have existed at compile time, ...
Read more >
'java.lang.NoSuchMethodError com.atlassian.sal.api.user ...
For example, JIRA 4.1 is not compatible with plugin version 1.1.1. Resolution. Check the compatibility chart in the Atlassian Universal Plugin Manager. Download ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found