Skip to content

Autowiring won't work when using scopes and targetClass auto proxying [SPR-4524] #9201

Closed
@spring-projects-issues

Description

@spring-projects-issues

David J. M. Karlsen opened SPR-4524 and commented

java.lang.IllegalStateException: Annotation-specified bean name 'portalUserRequestData' for bean class [XXXX.PortalUserRequestData] conflicts with existing, non-compatible bean definition of same name and class [org.springframework.aop.scope.ScopedProxyFactoryBean]

I've got a PortalUserRequestData bean declared as:
@Scope( "request" )
@Component

This is then injected in another bean as following:

@Autowired
private PortalUserRequestData portalUserRequestData;

and fails with the message above.

it can be noted that if the same bean is declared in XML (with scope=) and set on the other bean in xml (with set property, and ref="portalUserRequestData").
there's no problem - thus it's probably a bug in the spring core container.


Affects: 2.5.1

Attachments:

Issue Links:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions