spring-native icon indicating copy to clipboard operation
spring-native copied to clipboard

ConfigurationPropertiesBinder.Factory is exposed as a bean but not used to create ConfigurationPropertiesBinder

Open snicoll opened this issue 3 years ago • 3 comments

As discovered reviewing an issue in mybatis, Spring Boot uses a supplier to instantiate ConfigurationPropertiesBinder so that resolution for the ApplicationContext does not trigger early init of factory beans.

Unfortunately, we can't see what a supplier is doing and we're applying our fallback of trying to create the bean with the constructor and declared parameters. It worked so far but, with the early initialization.

We need to find a way to fix this in a generic fashion going forward but, for now, I think we can write a custom writer to avoid the problem.

snicoll avatar Jan 19 '22 15:01 snicoll

This introduced a regression so the change has been reverted and will be revisited.

snicoll avatar Jan 24 '22 12:01 snicoll

@snicoll Probably, the mybatis-spring-natvie seems to work fine with the latest 0.11.2 SNAPSHOT. See https://github.com/kazuki43zoo/mybatis-spring-native/runs/4930626598?check_suite_focus=true

kazuki43zoo avatar Jan 25 '22 14:01 kazuki43zoo

Yes, this is to be expected. The fix that I've added for MapperFactoryBean makes this issue not important for you.

snicoll avatar Jan 25 '22 15:01 snicoll

Spring Native is now superseded by Spring Boot 3 official native support, see the related reference documentation for more details.

As a consequence, I am closing this issue, and recommend trying your use case with latest Spring Boot 3 version. If you still experience the issue reported here, please open an issue directly on the related Spring project (Spring Framework, Data, Security, Boot, Cloud, etc.) with a reproducer.

Thanks for your contribution on the experimental Spring Native project, we hope you will enjoy the official native support introduced by Spring Boot 3.

sdeleuze avatar Jan 02 '23 12:01 sdeleuze