-
Notifications
You must be signed in to change notification settings - Fork 38.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Record beans do not compile to native images #30383
Comments
@ConfigurationProperties
It looks like the configuration properties smoke test started failing with a similar error on 19 April:
That was when the smoke tests were updated to test Boot 3.0.6 snapshots. This fits with the Framework changes being related as moving to Boot 3.0.6 snapshots meant we also upgraded to Framework 6.0.8. |
After b374824 related to gh-29246, `"queryAllDeclaredMethods": true` is now added on all registered beans. This legit change triggers oracle/graal#6510. This commit workarounds this GraalVM bug, and should be removed once the GraalVM fix has reached a wide enough audience. Closes gh-30383
Please create a task to remove the code or we will probably forget about it. Thanks! |
Hi, not sure if I should open a new issue of reopen this one but migrating my application to spring-boot 3.2.0 seems to break records again.
Here |
@AdrienBennadji, since this issue was closed 8 months ago, please open a new issue. And in that issue, please include a small example that reproduces the problem -- preferably a simple application or test class that we can run ourselves (either attached to the issue as a ZIP file or as a public Git repository). Thanks |
@sbrannen Thank you for your response. I upgraded the version of the Graalvm image i use to build my applications and it fixed the issue. |
After this change related to #29246 in Spring Framework 6.0.8,
"queryAllDeclaredMethods": true
is added on all registered beans (for good purpose).I think this change has uncovered the fact that Boot is not adding invocation hints for record components on
@ConfigurationProperties
(likeReflectionForBindingRegistrar
does on Framework side). Before Spring Framework 6.0.7, records components were, I guess, invisible so no error. With Spring Framework 6.0.8+,"queryAllDeclaredMethods": true
make those records components visible.That means with Boot 3.0.6, with:
I get the following error:
Can be reproduced with https://github.com/sdeleuze/demo-profile-aot when updating to Boot 3.0.6.
To avoid such error and properly support record component binding in
@ConfigurationProperties
, I think invocation hints should be added to record components for such class.The text was updated successfully, but these errors were encountered: