@JsonDeserialize(builder = ...)
does not work in GraalVM native image
#32238
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: backported
An issue that has been backported to maintenance branches
theme: aot
An issue related to Ahead-of-time processing
type: bug
A general bug
Milestone
Basically copy of #29646
I have verified that builders are still not supported in Spring Boot 3.2.2 (Spring 6.1.3) despite fixes in e6397c8
This is because only constructors are added as seen here:
spring-framework/spring-core/src/main/java/org/springframework/aot/hint/BindingReflectionHintsRegistrar.java
Line 182 in e6397c8
So what ends up happening is that the builder gets instantiated, but cannot finish creating the object via calling
#build
.If I add hints for
#build
, the objects would be empty, because no other builder methods are available. So basically the solution is to also add hints for all declared methods of the builder.The repro provided here is still viable.
I see that the registration is quite generic, as in doesn't "know" what it's doing, so doesn't know about
JsonDeserialize
and it's builder. I'm not sure how to add support forbuilder
in a generic way without adding specific logic aroundJsonDeserialize
, which goes against the idea of not going too deep into jackson support.Anyway, please have a look, thanks.
The text was updated successfully, but these errors were encountered: