Closed
Description
Christopher Smith opened SPR-12018 and commented
If an @Configuration
superclass provides a method annotated @Bean
, the JavaConfig system can start invoking the superclass's @Bean
methods before the actual object is fully constructed. If a subclass overrides one of these @Bean
methods, and the superclass depends on retrieving a valid object from it, the superclass's initialization will fail.
The JavaConfig system should not treat @Configuration
objects as live service objects until all dependencies have been injected and the @PostConstruct
methods called.
Affects: 4.0.6
Issue Links:
- @Autowired List<ToAutoWire> into Configuration that defines @Bean ToAutoWire fails [SPR-12646] #17247
@Autowired
List into Configuration that defines@Bean
ToAutoWire fails - Non-stable BeanCurrentlyInCreationException with wrong Java config [SPR-12004] #16620 Non-stable BeanCurrentlyInCreationException with wrong Java config
- Autowire bean in @Configuration class itself [SPR-12127] #16743 Autowire bean in
@Configuration
class itself - Regression in @Condition exclusion [SPR-12233] #16848 Regression in
@Condition
exclusion