org.springframework.data.redis.serializer.SerializationException: Cannot deserialize; nested exception is org.springframework.core.serializer.support.SerializationFailedException:Failed to deserialize payload. Is the byte array a result of corresponding serialization for DefaultDeserializer?; nested exception is org.springframework.core.NestedIOException:Failed to deserialize object type; nested exception is java.lang.ClassNotFoundException: com.foo.user.model.CurrentUser
I have two typical Spring Boot applications that share a Redis instance for session state. The above error happens immediately upon trying to log in to my application.
I'm not quite sure what's going on here - both applications use the same libraries and versions for the applicable User models and Spring dependencies. For what it's worth CurrentUser
extends org.springframework.security.core.userdetails.User
, which itself is Serializable
.
I've rebooted my Redis instance thinking something just got funky, but that was not the case. I'd show what I've tried already, but it's mostly been making sure my artifacts were built correctly and restarting application and Redis servers, with a little bit of toying around with Serializable
.
Why am I seeing this?