-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
Hints required for @Bean
+ @ConfigurationProperties
Kotlin (probably not only) classes
#33849
Comments
It looks like reflection metadata is being generated for constructor binding but setter-based binding is being used at runtime. That feels like a bug. |
Since this is a regression, do you have any view on fixing that? Cannot upgrade my dependencies without much changes, maybe at least some migration then? |
Why do you believe it's a regression? With what version does it work? |
@wilkinsona it worked for the last 4 years. |
Your problem appears to be specific to GraalVM and native images, support for which was added in 3.0 which was released in late 2022. How has it worked for the last 4 years? |
Yes, sorry, I am multithreading. I was thinking about the problem with Sorry, I did not read the title before I responded. |
With Spring Boot 3.0.9 the problem on longer occurs. |
Hello, this is a continuation from #33509.
The same example repo may be used, please see https://github.com/Azbesciak/spring-3-configuration-prop-issue with branch
config-prop-bean
and changed the spring boot version to3.0.2-SNAPSHOT
.The problem is that regarding https://docs.spring.io/spring-boot/docs/current/reference/html/native-image.html#native-image.advanced every
@ConfigurationProperties
(at least I understand it like this) should be managed by the native image, hints are no required, etc.Whereas it is unfortunately not true - when I generate the native image, it fails in the runtime with the following exception:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myServiceC': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'someBean': Runtime reflection is not supported for public void com.example.demo.SomeBean.setCustomValue(java.lang.String)
[...]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'someBean': Runtime reflection is not supported for public void com.example.demo.SomeBean.setCustomValue(java.lang.String)
The text was updated successfully, but these errors were encountered: