Skip to content

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

Closed

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

Activity

  1. spring-projects-issues commented on Apr 28, 2014

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    This has effectively been fixed along with #15620.

    Juergen

  2. added
    type: bug
    in: test
    status: backported
    in: core
    on Jan 11, 2019
  3. added this to the 4.0 GA milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: corein: teststatus: backportedtype: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions