@JsonDeserialize(using=MyCustomLocalDateDeserializer.class)
does not seem to be working in my project using Spring 3.0.4
and GraalVM latest. It works fine when running the project in my IDE to test, but fails with the following exception when running the image:
No default constructor found
Even though there is a default constructor defined in my implementation:
public class MyCustomLocalDateDeserializer extends StdDeserializer<LocalDate> {
public MyCustomLocalDateDeserializer() {
this(null);
}
public MyCustomLocalDateDeserializer(Class<LocalDate> t) {
super(t);
}
@Override
public LocalDate deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
...
}
}
I have placed the annotation on the field of a response object coming back from a web client call:
public class SomeResponseObject {
@JsonDeserialize(using = MyCustomLocalDateDeserializer.class)
private LocalDate someDate;
...
}
Does support for this not exist yet? I saw the below threads but was unsure if this specific case had been encountered yet.
https://github.com/spring-projects/spring-framework/issues/29646 https://github.com/spring-projects/spring-framework/issues/29386
Comment From: sdeleuze
I need to have a deeper look, but given the 2 issues you linked I would expect this to be supported. Could you please share a reproducer?
Comment From: tuckeremulls
I need to have a deeper look, but given the 2 issues you linked I would expect this to be supported. Could you please share a reproducer?
Yes here is a small replication of the issue: https://github.com/tuckeremulls/jsondeserialization-native-image-sample/tree/main
Thanks so much!