You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If multiple modules are used to map abstract types, deserialization might fail in 2.9+:
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of model.Datatype1 (no Creators, like default construct, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information
The bug can be reproduced for version 2.9+ in the attached maven project.
I guess the bug was introduced due to a modification of _mapAbstractType2 in com.fasterxml.jackson.databind.deser.BasicDeserializerFactory:
If multiple modules are used to map abstract types, deserialization might fail in 2.9+:
The bug can be reproduced for version 2.9+ in the attached maven project.
I guess the bug was introduced due to a modification of _mapAbstractType2 in com.fasterxml.jackson.databind.deser.BasicDeserializerFactory:
2.9:
JavaType concrete = resolver.findTypeMapping(config, type);
if (ClassUtil.rawClass(concrete) != currClass) {
return concrete;
}
2.8
if (concrete != null && concrete.getRawClass() != currClass) {
return concrete;
}
The not null check is needed for continuing iterating other modules for abstract type mappings.
jackson-error-example.zip
Best regards
Asger Christiansen
The text was updated successfully, but these errors were encountered: