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
Exception in thread "main" java.lang.IllegalStateException: Internal error: no creator index for property 'cause' (of type com.fasterxml.jackson.databind.deser.impl.MethodProperty)
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.getCreatorIndex(SettableBeanProperty.java:450)
at com.fasterxml.jackson.databind.deser.impl.PropertyValueBuffer.assignParameter(PropertyValueBuffer.java:363)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:449)
at com.fasterxml.jackson.databind.deser.std.ThrowableDeserializer.deserializeFromObject(ThrowableDeserializer.java:85)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:185)
at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:342)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4917)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3860)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3828)
at SubclassedExceptionJava.main(SubclassedExceptionJava.java:21)
Expected behavior
In versions before 2.18.0 the described code worked flawlessly and the Exception is parsed.
Additional context
If a no arg constructor is added, the example works (even for versions 2.18.0 - 2.18.2)
The text was updated successfully, but these errors were encountered:
But versions <= 2.17.3 will throw a com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "suppressed" (class util.SubclassedExceptionJava), not marked as ignorable (3 known properties: "cause", "stackTrace", "message"]) because there are only setters / constructors in Throwable for cause, stackTrace and message.
Search before asking
Describe the bug
The deserialization of Throwables fails if they are subclassed without a no-arg constructor.
Version Information
Seems to affect versions 2.18.0 - 2.18.2
Reproduction
The following exception is thrown:
Expected behavior
In versions before 2.18.0 the described code worked flawlessly and the Exception is parsed.
Additional context
If a no arg constructor is added, the example works (even for versions 2.18.0 - 2.18.2)
The text was updated successfully, but these errors were encountered: