Add core-di: constructor vs setter vs field injection and @Autowired candidate resolution on Boot 4.1
Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JoVmf2fWvcpoXndcDSwRf7
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# Constructor cycle vs field cycle: plain Spring and Spring Boot
|
||||
|
||||
|
||||
--- plain Spring, constructor cycle (CtorA <-> CtorB) ---
|
||||
started: false
|
||||
root cause: org.springframework.beans.factory.BeanCurrentlyInCreationException
|
||||
Error creating bean with name 'ctorA': Requested bean is currently in creation: Is there an unresolvable circular reference or an asynchronous initialization dependency?
|
||||
|
||||
--- plain Spring, field cycle (FieldA <-> FieldB) ---
|
||||
started: true
|
||||
FieldA.b is FieldB: true
|
||||
|
||||
--- Spring Boot, field cycle, default settings ---
|
||||
FAILED: BeanCurrentlyInCreationException: Error creating bean with name 'fieldA': Requested bean is currently in creation: Is there an unresolvable circular reference or an asynchronous initialization dependency?
|
||||
|
||||
--- Spring Boot, field cycle, spring.main.allow-circular-references=true ---
|
||||
started
|
||||
|
||||
--- Spring Boot, constructor cycle, spring.main.allow-circular-references=true ---
|
||||
FAILED: BeanCurrentlyInCreationException: Error creating bean with name 'ctorA': Requested bean is currently in creation: Is there an unresolvable circular reference or an asynchronous initialization dependency?
|
||||
Reference in New Issue
Block a user