Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SpringBoot 2.5.0 For Jackson Kotlin classes support please add "com.fasterxml.jackson.module: jackson-module-kotlin" to the classpath

This is now fixed with SpringBoot 2.5.1

Small question about a warning I am receiving please.

After the release of 2.5.0 of SpringBoot, I just did a version bump from 2.4.x to 2.5.0, without any code change.

Suddenly, on application start up, I am getting

kground-preinit] o.s.h.c.j.Jackson2ObjectMapperBuilder: For Jackson Kotlin classes support please add "com.fasterxml.jackson.module:jackson-module-kotlin" to the classpath

The thing is, my Springboot all is not a Kotlin app, it is a Java app.

It has nothing Kotlin.

Furthermore, I am not even doing any explicit JSON parsing.

May I ask how I can disable, resolve this warning please?

like image 742
PatPatPat Avatar asked May 21 '21 02:05

PatPatPat


1 Answers

Edit: Just upgrade to Spring Boot 2.5.1 where this is resolved.


Old answer below:

I managed to fix this for now by adding exclusions to my spring-boot-starter-security dependency which apparently defined this Kotlin dependency.

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-security</artifactId>
    <exclusions>
        <exclusion>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-reflect</artifactId>
        </exclusion>
    </exclusions>
</dependency>
like image 97
Sebastiaan van den Broek Avatar answered Oct 13 '22 17:10

Sebastiaan van den Broek