You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The serialization runtime associates with each serializable class a version number, called a serialVersionUID, which is used during deserialization to verify that the sender and receiver of a serialized object have loaded classes for that object that are compatible with respect to serialization
Current Behavior
Currently, every Serializable class's serialVersionUID field is changed with every minor version.
Context
The company I work for uses a cluster of servers as a gateway that check Authentication/Authorization, before forwarding requests to other web applications. The servers in this cluster have to share sessions with each other. When doing a rolling update, the new and old versions cannot communicate with each other if they have different versions of spring security. This results in two negative outcomes.
Negative impact on uptime, as we have to shutdown the entire cluster once in a while to remove all stale caches (some cluster only use embedded infinispan/hazelcast)
Negative impact on user experience, as every user has to sign themselves in again each time such an update happens.
The text was updated successfully, but these errors were encountered:
Dupe of #3737, which may have been closed incorrectly.
You can work around it by implementing a custom ObjectInputStream:
@OverrideprotectedObjectStreamClassreadClassDescriptor() throwsIOException, ClassNotFoundException {
ObjectStreamClassdescriptor = super.readClassDescriptor();
if (descriptor.getName().startsWith("org.springframework.security.")) {
// ignore the serialized version and use the current version insteadreturnObjectStreamClass.lookupAny(Class.forName(descriptor.getName()));
} else {
returndescriptor;
}
}
Expected Behavior
The serialVersionUID field in Serializable classes should only be increased after introducing breaking changes (eg. new fields/methods) in a class.
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Serializable.html
Current Behavior
Currently, every Serializable class's serialVersionUID field is changed with every minor version.
Context
The company I work for uses a cluster of servers as a gateway that check Authentication/Authorization, before forwarding requests to other web applications. The servers in this cluster have to share sessions with each other. When doing a rolling update, the new and old versions cannot communicate with each other if they have different versions of spring security. This results in two negative outcomes.
The text was updated successfully, but these errors were encountered: