Closed
Description
Mathew Wyatt opened SPR-4054 and commented
When i have a "prototype" (defined as prototype in the spring-config) bean which implements the ApplicationContextAware interface, it is eagerly instantiated when the application context is loaded. Which means i have a bean floating around in space which i can not get reference to. It seems poor practice to have a floating unreferenced (unreferenced by me explicitly) bean floating around?... In my case, the floating bean is throwing runtime exceptions, because of dependencies on a swing ancestor component...
see post - http://forum.springframework.org/showthread.php?t=44522&highlight=ApplicationContextAware
Affects: 2.0.7
Issue Links:
- ApplicationListeners cannot be lazy initialized [SPR-4111] #8790 ApplicationListeners cannot be lazy initialized ("is duplicated by")
- Prototype beans that implement ApplicationListener shouldn't be created during container initialization [SPR-5247] #9921 Prototype beans that implement ApplicationListener shouldn't be created during container initialization