-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Closed
Copy link
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug
Milestone
Description
Tom Ziemer opened SPR-9580 and commented
When injecting a prototype bean into a test derived from AbstractJUnit4SpringContextTests using @Resource, it seems that the bean is only created once.
Prior to Spring 3.1.2 this was not the case, the framework provided a new instance for each test run.
As a workaround, I now use @Autowired + @Qualifier.
The attached project uses a unit test to show the problem. Changing the Spring version to 3.1.1-RELEASE (or lower) in the pom fixes the issue.
Affects: 3.1.2
Attachments:
- resourceIssue.zip (4.04 kB)
Issue Links:
- Regression: scoped beans being cached too aggressively [SPR-9627] #14261 Regression: scoped beans being cached too aggressively
5 votes, 6 watchers
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: bugA general bugA general bug