com.fasterxml.jackson.databind.JsonMappingException: Class JacksonSubclassCollectionTest$SomeBaseClass not subtype of [simple type, class JacksonSubclassCollectionTest$SomeSubClass] at [Source: {"collection":[{"type":"SUBCLASS","field":7}]}; line: 1, column: 1]


Solutions on the web

Solution icon of github
Class JacksonSubclassCollectionTest$SomeBaseClass not subtype of [simple type, class JacksonSubclassCollectionTest$SomeSubClass] at [Source: {"collection":[{"type":"SUBCLASS","field":7}]}; line: 1, column: 1]

Solution icon of github
via GitHub by azuritus
, 1 year ago
Class Jackson1311$B not subtype of [simple type, class Jackson1311$C] at [Source: {}; line: 1, column: 1]

Solution icon of github
Class com.example.test.JacksonTest$Default not subtype of [simple type, class com.example.test.JacksonTest$Inner] at [Source: N/A; line: -1, column: -1]

Solution icon of github
Class PolymorphicDeserialiationTest$Unknown not subtype of [simple type, class PolymorphicDeserialiationTest$A] at [Source: {"type":"B","a":{"type":"A"}}; line: 1, column: 9]

Solution icon of googlegroups
via Google Groups by Unknown author, 2 months ago
Could not resolve type id 'hdfs' into a subtype of [simple type, class io.druid.segment.loading.LoadSpec] at [Source: N/A; line: -1, column: -1]

Solution icon of github
Could not resolve type id 'Turtle' into a subtype of [simple type, class mypackage.Animal] at [Source: N/A; line: -1, column: -1] (through reference chain: mypackage.Zoo["animals"])

Solution icon of googlegroups
Could not resolve type id 'c*' into a subtype of [simple type, class io.druid.segment.loading.LoadSpec] at [Source: N/A; line: -1, column: -1]

Solution icon of stackoverflow
Could not resolve type id 'Turtle' into a subtype of [simple type, class mypackage.Animal] at [Source: N/A; line: -1, column: -1] (through reference chain: mypackage.Zoo["animals"])

Solution icon of googlegroups
Could not resolve type id 'index_kafka' into a subtype of [simple type, class io.druid.indexing.common.task.Task] at [Source: [B@6e841513; line: 1, column: 2]

Solution icon of googlegroups
Could not resolve type id 'namespace' into a subtype of [simple type, class io.druid.query.extraction.LookupExtract or] at [Source: HttpInputOverHTTP@328be276; line: 1, column: 259] (through reference chain: java.util.ArrayList[0])

Stack trace

com.fasterxml.jackson.databind.JsonMappingException: Class JacksonSubclassCollectionTest$SomeBaseClass not subtype of [simple type, class JacksonSubclassCollectionTest$SomeSubClass]
 at [Source: {"collection":[{"type":"SUBCLASS","field":7}]}; line: 1, column: 1]
	at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:296)
	at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:269)
	at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244)
	at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142)
	at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:475)
	at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:3890)
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3785)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2833)
	at JacksonSubclassCollectionTest.main(JacksonSubclassCollectionTest.java:20)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: java.lang.IllegalArgumentException: Class JacksonSubclassCollectionTest$SomeBaseClass not subtype of [simple type, class JacksonSubclassCollectionTest$SomeSubClass]
	at com.fasterxml.jackson.databind.type.TypeFactory.constructSpecializedType(TypeFactory.java:359)
	at com.fasterxml.jackson.databind.jsontype.impl.StdTypeResolverBuilder.buildTypeDeserializer(StdTypeResolverBuilder.java:118)
	at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.findTypeDeserializer(BasicDeserializerFactory.java:1363)
	at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.findPropertyContentTypeDeserializer(BasicDeserializerFactory.java:1526)
	at com.fasterxml.jackson.databind.deser.BasicDeserializerFactory.resolveMemberAndTypeAnnotations(BasicDeserializerFactory.java:1841)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.constructSettableProperty(BeanDeserializerFactory.java:735)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.addBeanProps(BeanDeserializerFactory.java:520)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:226)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:141)
	at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:406)
	at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:352)
	at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264)
	... 12 more

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

2 times, 1 week ago
8 times, 5 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
6 more bugmates