nebula186
nebula186

Reputation: 149

Jackson upgrade causing deserialization error with Kotlin

Upgraded to jackson 2.12.x and it's been failing my builds in Kotlin 1.3.x which seemingly for a method not being available. I'm unable to figure out if this is breaking change coming from Jackson.

 Caused by: java.lang.NoSuchMethodError: kotlin.reflect.KClass.getSealedSubclasses()Ljava/util/List; 
|   at com.fasterxml.jackson.module.kotlin.KotlinAnnotationIntrospector.findSubtypes(KotlinAnnotationIntrospector.kt:72) 
|   at com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair.findSubtypes(AnnotationIntrospectorPair.java:263) 
|   at com.fasterxml.jackson.databind.introspect.AnnotationIntrospectorPair.findSubtypes(AnnotationIntrospectorPair.java:263) 
|   at com.fasterxml.jackson.databind.jsontype.impl.StdSubtypeResolver._collectAndResolveByTypeId(StdSubtypeResolver.java:288) 
... jackson internals omitted ...
|   at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3601) 
|   at com.xxxxxxx.util.JacksonSerializationHelper.deserialize(JacksonSerializationHelper.kt:94) 

Upvotes: 1

Views: 2317

Answers (1)

Sweet Chilly Philly
Sweet Chilly Philly

Reputation: 3219

Looks like some things have been depreciated in the upgrade.

You need to look at the upgrade notes, because this method doesn't exist anymore getSealedSubclasses()

You might find the answer here: https://github.com/FasterXML/jackson/wiki/Jackson-Releases

If you cant find it here, you will need to create a bug report

Upvotes: 1

Related Questions