I am working on Java Springboot project which is deployed on Weblogic (12C) I am getting below error:
Message icon - Error java.lang.ClassNotFoundException:com.fasterxml.jackson.core.exc.InputCoercionException
I have following dependency in POM.xml:
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.1</version>
</dependency>```
Even in Notepad, people have done java coding and by using the “ javac” command to compile the java files, and they will create a ‘.class’ file. Sometimes accidentally the generated class files might be lost or set in different locations and hence there are a lot of chances of “ClassNotFoundException” occurs.
I had the same issue, i had updated the jackson-databind jar to 2.11.0, whereas jackson-core was using 2.6.6. Jackson-core is the base on which Jackson data-binding package builds on.
While all other Jackson dependencies were 2.8.0 and one of them was 2.11.0 and changing all to be 2.8.0 fixed it. FYI, 2.11 is the latest but due to my legacy code, i kept it as 2.8 as well.
Add the following dependency to your pom.xml
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.10.1</version>
</dependency>
I had the same issue, i had updated the jackson-databind jar to 2.11.0, whereas jackson-core was using 2.6.6. Jackson-core is the base on which Jackson data-binding package builds on.
If you're using maven for your dependency management, just include jackson-databind jar dependency and it should inject jackson-core dependency in your classpath as it has transitive dependency on this
Identify the jackson-core and jackson-databind version, by running this command in commandprompt of your project folder. For maven : mvn dependency:tree
E.g of my dependencies
com.fasterxml.jackson.core:jackson-databind:jar:2.11.0:compile com.fasterxml.jackson.core:jackson-core:jar:2.6.6:test
I am using 2.6.6 for running my test cases, so the scope is test.
So Solution, upgraded the jackson-core to 2.11.0 and build it. It will pass.
I had this same issue, using the dataformat and databind libraries. It seems that in the new update you have to add the core library in order for the others to work:
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.10.1'
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