Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.JavaType not found

I was getting this error because someone else in some other class was using org.codehaus.jackson package and I am using com.fasterxml.jackson package. And because of this conflict of jars, it was throwing this ClassNotFoundException. Once I removed and replaced those fasterxml jars with codehaus jars, it started working fine.


We can add below dependencies in our pom.xml and all type of jackson error will be resolved

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

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