java.lang.ClassNotFoundException: com.fasterxml.jackson.annotation.JsonInclude$Value

We Are Going To Discuss About java.lang.ClassNotFoundException: com.fasterxml.jackson.annotation.JsonInclude$Value. So lets Start this Java Article.

java.lang.ClassNotFoundException: com.fasterxml.jackson.annotation.JsonInclude$Value

  1. java.lang.ClassNotFoundException: com.fasterxml.jackson.annotation.JsonInclude$Value

    Jackson marshalling/unmarshalling requires following jar files of same version.
    jackson-core
    jackson-databind
    jackson-annotations
    Make sure that you have added all these with same version in your classpath. In your case jackson-annotations is missing in classpath.

  2. java.lang.ClassNotFoundException: com.fasterxml.jackson.annotation.JsonInclude$Value

    Jackson marshalling/unmarshalling requires following jar files of same version.
    jackson-core
    jackson-databind
    jackson-annotations
    Make sure that you have added all these with same version in your classpath. In your case jackson-annotations is missing in classpath.

Solution 1

How about adding this to your pom.xml

<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-annotations</artifactId>
    <version>${jackson.version}</version>
</dependency>

Original Author MonoThreaded Of This Content

Solution 2

Jackson marshalling/unmarshalling requires following jar files of same version.

  1. jackson-core

  2. jackson-databind

  3. jackson-annotations

    Make sure that you have added all these with same version in your classpath. In your case jackson-annotations is missing in classpath.

Original Author Vino Of This Content

Solution 3

I had the same error message. In my case, Jackson consisted of multiple JAR files. Sadly, they had different versions of jackson-core and jackson-annotations which resulted in the above exception.

Maybe you don’t have the jackson-annotation JAR in your classpath, at least not in the correct version. You can analyze the used library versions with the command mvn dependency:tree.

Original Author Marcus K. Of This Content

Solution 4

I had different version of annotations jar. Changed all 3 jars to use SAME version of databind,annotations and core jackson jars

<dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>2.8.6</version>
</dependency>

Original Author Saurabh Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment