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
AOT-generated code no longer sets bean class for beans created from a @Bean
method
#31242
Comments
Thanks for the report. I am afraid we will need a bit more detail, as the two definitions above should be identical. Please share a small sample that we can use to reproduce the problem. You can share it with us by pushing it to a separate GitHub repository. |
The repository: https://github.com/itineric/spring-framework-issue-31242 Started with the Hello world to reproduce it easilly. Expected output is:
And it is working with following dependency (and previous versions):
When switching to version 3.1.2
output changes to (bean class name is now null)
More precisely, the fault is with the spring-boot version that switches from 6.0.10 to 6.0.11. |
Thanks for the feedback. I've edited your comment to remove what you've already stated in the original description. We've now established that a If you need to access the beanClass, Can you share a bit more about the actual @jhoeller wondering if we could change things a bit in |
The first BeanFactoryPostProcessor I am getting troubles with is: https://github.com/resteasy/resteasy-spring/blob/main/resteasy-spring/src/main/java/org/jboss/resteasy/plugins/spring/SpringBeanProcessor.java Why it does not work anymore with null? I may have others but started the digging with this one. |
Something odd related to this: the AOT generated code is not the same when the With
With
|
This comment was marked as outdated.
This comment was marked as outdated.
OK now that I've actually looked at the code, I can see what's happening. Regarding:
This is generated if the bean definition we're inspecting actually does not have a beanClass. So this I think the thing that's checking for the beanClass might be missing a case. I'll have a look. |
@Bean
method
It isn't, really. beans produced by a We do restore the I can't say enough about RESTEasy but I think the code there is a bit fragile and should probably be updated. |
@Bean
method@Bean
method
When using spring native with AOT processing, source generation for bean with version 6.0.10 produces:
Using version 6.0.11 produces:
Then, when entering a
postProcessAfterInitialization
method of aBeanFactoryPostProcessor
, the bean definition seems uncomplete using 6.0.11. Did not figured out why yet, but stuff working with aot and native for month stops working when using 6.0.11 of spring-boot.I used generated sources from an AOT processing performed with 6.0.10 to produce an artifact with version 6.0.11, These 2 lines make the behaviour change.
The text was updated successfully, but these errors were encountered: