jackson-module-kotlin: Broken Kotlin 1.4 support in 2.13.2

Actual

Using Kotlin 1.4.32 and Jackson 2.13.2.20220324 with jackson-module-kotlin I’m getting an exception

Caused by: java.lang.NoSuchMethodError: 'boolean kotlin.reflect.KClass.isValue()'
	at com.fasterxml.jackson.module.kotlin.KotlinAnnotationIntrospector.findSerializer(KotlinAnnotationIntrospector.kt:88)
	at com.fasterxml.jackson.module.kotlin.KotlinAnnotationIntrospector.findSerializer(KotlinAnnotationIntrospector.kt:26)
	at com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair.findSerializer(AnnotationIntrospectorPair.java:334)
	at com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair.findSerializer(AnnotationIntrospectorPair.java:334)
	at com.fasterxml.jackson.databind.ser.BasicSerializerFactory.findSerializerFromAnnotation(BasicSerializerFactory.java:540)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory._constructWriter(BeanSerializerFactory.java:862)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.findBeanProperties(BeanSerializerFactory.java:630)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.constructBeanOrAddOnSerializer(BeanSerializerFactory.java:401)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.findBeanOrAddOnSerializer(BeanSerializerFactory.java:294)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory._createSerializer2(BeanSerializerFactory.java:239)
	at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.createSerializer(BeanSerializerFactory.java:173)
	at com.fasterxml.jackson.databind.SerializerProvider._createUntypedSerializer(SerializerProvider.java:1495)
	at com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1443)
	at com.fasterxml.jackson.databind.SerializerProvider.findValueSerializer(SerializerProvider.java:544)
	at com.fasterxml.jackson.databind.SerializerProvider.findTypedValueSerializer(SerializerProvider.java:822)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:308)
	at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4568)
	at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsBytes(ObjectMapper.java:3844)

The same code works fine with Jackson 2.13.1

The regression is introduced in https://github.com/FasterXML/jackson-module-kotlin/pull/527 kotlin.reflect.KClass.isValue() was added in Kotlin 1.5 and not available in 1.4: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.reflect/-k-class/is-value.html

Expected

  • get Kotlin 1.4 support back (the last release of 1.4 was not that long time ago to consider it end of life https://github.com/JetBrains/kotlin/releases/tag/v1.4.32) or
  • explicitly state which versions of kotlin are supported by this module and that Kotlin 1.4 got dropped in 2.13.2. Jackson Kotlin Module’s release notes are stating: “No changes since 2.13.1?” for 2.13.2.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 20 (18 by maintainers)

Commits related to this issue

Most upvoted comments

No firm plans for 2.13.4 release (it will take a while), due to there being few issues fixed.

If there is desire to get 2.13.3.1 out I could be persuaded to do that – if so, please let me know. But I do not want to release something that would not help you (wrt #523) being incomplete.

Hi! Sorry for bumping this.

Is there a planned release date for 2.13.4, 2.13.3.1 or whatever the closest version with this fix is? 😃

We updated our library to latest to get rid of jackson-databind#2816, but we can’t drop support for 1.4 just yet, otherwise we might have problems with Gradle 6

Asking because we’ll wait if it’s around the corner, but we’ll have to downgrade to 2.12 it if it’s not yet planned 😦

Update: it looks like https://github.com/FasterXML/jackson-module-kotlin/issues/523 doesn’t support 1.4 also, so fixing this issue doesn’t really solve 1.4 support problem completely

@cowtowncoder Sure, sign me in, and let’s keep it alive 😉