Skip to content

Spring may invoke @Bean methods too early in case of a circular reference [SPR-12018] #16634

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions