Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Uu7q8vPeREyT4218EJPzz1
22 lines
1.5 KiB
Plaintext
22 lines
1.5 KiB
Plaintext
# The same field cycle, with @Async on AsyncFirst and the flag on: start-up versus a lazy first getBean
|
|
|
|
|
|
--- eager start-up (the default) ---
|
|
start creating com.ankurm.corebeans.cycles.allowed.AsyncFirst
|
|
start creating com.ankurm.corebeans.cycles.allowed.AsyncSecond
|
|
AsyncSecond constructed, identity 2f0ed952
|
|
AsyncSecond.setFirst on instance 2f0ed952 received a proxy: false
|
|
AsyncSecond constructed, identity 5a8816cc
|
|
AsyncSecond.setFirst on instance 5a8816cc received a proxy: true
|
|
started: true
|
|
AsyncFirst bean is a proxy : true
|
|
AsyncSecond.first is a proxy : true
|
|
AsyncSecond.first == the bean : true
|
|
log line from DefaultListableBeanFactory (INFO):
|
|
Bean 'com.ankurm.corebeans.cycles.allowed.AsyncFirst' marked for pre-instantiation (not lazy-init) but currently initialized by other thread - skipping it in mainline thread
|
|
|
|
--- spring.main.lazy-initialization=true, then getBean(AsyncFirst.class) ---
|
|
started: true
|
|
getBean(AsyncFirst.class) failed: BeanCurrentlyInCreationException
|
|
root cause: Error creating bean with name 'com.ankurm.corebeans.cycles.allowed.AsyncFirst': Bean with name 'com.ankurm.corebeans.cycles.allowed.AsyncFirst' has been injected into other beans [com.ankurm.corebeans.cycles.allowed.AsyncSecond] in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesForType' with the 'allowEagerInit' flag turned off, for example.
|