views:

54

answers:

1

When I stop my server I get this exception:

SEVERE: Exception loading sessions from persistent storage
java.lang.IllegalStateException: Cannot deserialize BeanFactory with id org.springframework.web.context.WebApplicationContext:/Life: no factory registered for this id
    at org.springframework.beans.factory.support.DefaultListableBeanFactory$SerializedBeanFactoryReference.readResolve(DefaultListableBeanFactory.java:953)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at java.io.ObjectStreamClass.invokeReadResolve(Unknown Source)

Why is that?

A: 

My guess: when spring beans are serialized (for example, as part of the http session), on restoring spring tries not to restore their original values (since they might be meaningless after the deserialization), but instead tries to fetch them by their id. If you have changed your bean definitions and have removed the bean in question, and spring tries to deserialize it (from where it has serialized it, under circumstances which I don't know based on the information given), it would throw the exception that no such bean exists.

Bozho
Can you please lead me to ideas of how to solve it?
Odelya
give me more information - more of the stacktrace (if any), what is the scope is/was this bean, and has it really existed and was removed.
Bozho