Closed
Description
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:
- Scoped proxies are fragile with respect to serialization [SPR-14117] #18689 Scoped proxies are fragile with respect to serialization
- Reserializing a lenient fallback DefaultListableBeanFactory causes an error [SPR-17508] #22040 Reserializing a lenient fallback DefaultListableBeanFactory causes an error