Skip to content

ClassCastException during deserialization of ScopedObject [SPR-15766] #20321

Closed
@spring-projects-issues

Description

@spring-projects-issues

Dave Syer opened SPR-15766 and commented

A ScopedObject (as is created by a @Bean in @SessionScope for example) has a reference to the BeanFactory that created it, and when it is serialized and deserialized the BeanFactory is re-hydrated by looking it up in a global map.

The fix for #18689 made this process more robust, but it has now exposed another corner case because the StaticListableBeanFactory that it creates as a fallback is not a ConfigurableBeanFactory, and a DefaultScopedObject has a field of that type, so when it is deserialized there is a class cast exception.


Affects: 4.3.9

Reference URL: spring-projects/spring-session#799

Issue Links:

Referenced from: commits c9ffa64, fd2b4f2

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