Closed
Description
Piotr Findeisen opened SPR-14333 and commented
repro steps
- Have a
prototype
bean with a@Lookup
method. - Try to acquire it (for the first time) from 2 or more threads concurrently
- Call the
@Lookup
on acquired instance (either directly if it'spubic
, or call other method that uses the@Lookup
method if that one isprotected
expected
@Lookup
intercepted and served by the DI container
observed
- Sometimes, the
@Lookup
method is not overridden, as if there was some kind of race condition or other concurrency issue in handling of that annotation.
workaround
Use <lookup-method/>
in XML configuration. That one is handled at parse time, which is definitely single threaded, and does not suffer from concurrent lazy initialization.
Affects: 4.2.2, 4.2.6
Referenced from: commits 9131ebb, 47c62fd
Backported to: 4.2.7