Hello, this is a continuation from https://github.com/spring-projects/spring-boot/issues/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 to 3.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)
Comment From: wilkinsona
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.
Comment From: Azbesciak
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?
Comment From: wilkinsona
Why do you believe it's a regression? With what version does it work?
Comment From: Azbesciak
@wilkinsona it worked for the last 4 years.
Comment From: wilkinsona
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?
Comment From: Azbesciak
Yes, sorry, I am multithreading. I was thinking about the problem with @ConfigurationProperties and bean related annotation, mentioned in
https://github.com/spring-projects/spring-boot/issues/33509#issuecomment-1627732065.
Sorry, I did not read the title before I responded. Yes, for that case it cannot be for the last 4 years, for sure, since there was no native support for spring.
Comment From: wilkinsona
With Spring Boot 3.0.9 the problem on longer occurs.