@Autowired Spring singletons are initialized more than once, wired incorrectly
Hi,
This post is a spin-off from my SO post [1] which contains full details.
The short story is that I have a bean graph with singleton beans (let's call them A, B and C), @Autowired to each other as circular dependencies. The trouble is that after initial app context startup beans B and C contain different @Autowired instances of bean A.
My investigation shows that this problem is specific to @Autowiring and, unfortunately, this can not be reproduced on a minimized scale.
Does this look like a bug in Spring to anyone? Or is this expected (and if so - documented)?
1. http://stackoverflow.com/questions/1...of-a-singleton
1 Attachment(s)
Please find the example attached
Hi,
I have attached an example which shows how to autowire the beans. If followed in the way which has been depicted in the attachment, you problem might get resolved. Please let me know if you need more help on this.
Thanks