Skip to content

Cannot override singleton with scoped proxy [SPR-10744] #15370

Closed
@spring-projects-issues

Description

@spring-projects-issues

Mike opened SPR-10744 and commented

For testing purposes, I am trying to override a bean configured as a singleton (in production) by making it a scoped proxy using a custom testing scope. The testing configuration extends the production configuration.

However, this bean is never loaded as a scoped proxy at all! When I apply the test configuration, the bean is always autowired as a singleton instead of (the desired) scoped proxy (regardless whether it's a CGLIB or JDK dynamic proxy).


Affects: 3.2.2, 3.2.3

Reference URL: http://stackoverflow.com/questions/17688326/overriding-a-singleton-with-a-scoped-proxy

Issue Links:

Referenced from: commits d0f9853, 299776f

Backported to: 3.2.5

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)in: testIssues in the test modulestatus: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions