Skip to content

Circular reference of request scoped beans throws OutOfMemoryError or infinite loop. [SPR-2767] #7455

Closed
@spring-projects-issues

Description

@spring-projects-issues

Mike Youngstrom opened SPR-2767 and commented

If I have two request scoped beans who reference each other when I attempt to load one of those beans I get an OutOfMemoryException because of an infinite loop.

Example:

<bean name="someBean" scope="request">
<property name="someOtherBean" ref="someOtherBean"/>
</bean>
<bean name="someOtherBean" scope="request">
<property name="someBean" ref="someBean"/>
</bean>

Even if circular references of non singleton scoped beans is not supported we should probably not have an infinite loop if it's possible to avoid.

Mike


Affects: 2.0 final

Issue Links:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions