Skip to content

Bean creation does not propagate the current calling AccessControlContext [SPR-4543] #9220

@spring-projects-issues

Description

@spring-projects-issues

Rostislav Georgiev Georgiev opened SPR-4543 and commented

When invoking getBean(...) from within a PrivilegedAction and the bean is not yet initialized (scope="prototype") it gets created inside PrivilegedAction  in the AbstractAutowireCapableBeanFactory. But without propagating the outer(calling) AccessControlContext. So if your bean creation(initialization) relays on the calling context, it will fail.
The issue was introduced after the fix of http://jira.springframework.org/browse/SPR-4017 

I can also provide a simple test case, if it's needed.


Affects: 2.5.2

Attachments:

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