Deserialization exception in native image with DTO with @ConstructorProperties #32288
Labels
for: external-project
Needs a fix in external project
theme: aot
An issue related to Ahead-of-time processing
Problem
With the below setup:
I'm getting the following exception:
When trying to deserialize the object, but everything works perfectly when using a java application (non native).
Initially discovered when using a feign client, but it is reproducible by just using rest template.
Investigation results
At first I thought this was a hint issue, but I checked and they were indeed automatically generated.
I tried adding the constructor as a method hint manually, but that didn't help.
@OlgaMaciaszek was able to reproduce this on this branch. See instructions how to build and how to run
Personally I believe the issue might be with
AbstractJackson2HttpMessageConverter
, please have a look.Workarounds
Everything works in either case:
record
.@JsonCreator
is added to the constructorThese workarounds are generally acceptable, although would require a lot of effort to implement across multiple services.
Since the constructor is present, the hint for it as well, I believe that native should be able to detect everything just as java would.
Environment
Related Issues
The text was updated successfully, but these errors were encountered: