-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Remove usage of bean definition instance supplier since not compatible with AOT #33763
Comments
|
I found these places where we use an instance supplier:
And usages which are not used in AOT:
Not 100% sure that i found them all. |
I started working on it here: https://github.com/mhalbritter/spring-boot/tree/mh/33763 I'm unable to solve these usages: And i'm not sure if this change has unintended consequences: spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBinder.java Any help would be appreciated :) |
For |
Indeed, there are no changes needed in |
Bean definitions with instance supplier callbacks can't be supported by design on AOT as explained in spring-projects/spring-framework#29555. Spring Framework is going to document this and throw an exception during AOT processing of such bean via spring-projects/spring-framework#29556 instead of silently ignoring the instance supplier when a default constructor on the bean class is found.
While working on changing that behavior, I noticed a few Spring Boot beans are defining instance suppliers (there may be other ones, this is just on a simple app):
org.springframework.boot.context.properties.BoundConfigurationProperties
org.springframework.boot.web.server.WebServerFactoryCustomizerBeanPostProcessor
org.springframework.boot.web.server.ErrorPageRegistrarBeanPostProcessor
It currently works because the instance supplier references the bean class default constructor and because Spring Framework silently ignores them, but we would like to report proper error to the user when that's the case.
Could you please update Spring Boot codebase to remove the few usages of bean instance suppliers? I will also check the other project portfolio via the AOT smoke tests and reach the related teams.
The text was updated successfully, but these errors were encountered: