Skip to content

ApplicationListener beans eagerly instantiated even when marked as lazy-init [SPR-4054] #8733

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions