advancedSpring Internals — Bean Lifecycle & Proxies
Why does declaring a BeanFactoryPostProcessor as a non-static @Bean sometimes break @Value placeholder injection?
BeanFactoryPostProcessors must be instantiated very early, before normal bean instantiation and before @Value placeholders are resolved. A non-static @Bean method inside a @Configuration class can force that configuration class itself to be instantiated too early, before property sources are fully set up.
This is a Pro question
Sign in, then upgrade to Pro or Power to unlock this question and the full Interview Prep bank.
Why does declaring a BeanFactoryPostProcessor as a non-static @Bean sometimes break @Value placeholder injection?