jackson-module-kotlin: java.lang.NoClassDefFoundError: kotlin/jvm/JvmInline

I hope to support both Java and kolitin in my project, but Jackson module kotlin is introduced into my POM. In the Java environment, this package will report errors

java.lang.NoClassDefFoundError: kotlin/jvm/JvmInline
	at com.fasterxml.jackson.module.kotlin.ExtensionsKt.isUnboxableValueClass(Extensions.kt:122) ~[jackson-module-kotlin-2.13.0.jar:2.13.0]
	at com.fasterxml.jackson.module.kotlin.KotlinSerializers.findSerializer(KotlinSerializers.kt:69) ~[jackson-module-kotlin-2.13.0.jar:2.13.0]
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory._createSerializer2(BeanSerializerFactory.java:215) ~[jackson-databind-2.13.0.jar:2.13.0]
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.createSerializer(BeanSerializerFactory.java:173) ~[jackson-databind-2.13.0.jar:2.13.0]
	at com.fasterxml.jackson.databind.SerializerProvider._createUntypedSerializer(SerializerProvider.java:1495) ~[jackson-databind-2.13.0.jar:2.13.0]
	at com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1443) ~[jackson-databind-2.13.0.jar:2.13.0]
	at com.fasterxml.jackson.databind.SerializerProvider.findContentValueSerializer(SerializerProvider.java:777) ~[jackson-databind-2.13.0.jar:2.13.0]

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 4
  • Comments: 17 (11 by maintainers)

Commits related to this issue

Most upvoted comments

My guess is that it is due to a combination of Kotlin versions.

JvmInline is a class introduced in Kotlin 1.5. Since jackson-module-kotlin is Kotlin 1.5 since 2.13, I think that using 2.12 series will solve the problem.

I’ve encountered the same thing on upgrading from Spring Boot 2.4.x to 2.6.1.

Upgrading from kotlin version 1.4.0 to 1.6.0 fixed this for me weirdly. I’ve not had time to figure out why.