启动本地项目的时候遇到控制台报以下问题:
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.xxx
这是因为启动时当从Redis中获取缓存的时候序列化报错。Redis存储了另外一个项目中同样类名称的实体,启动新项目的时候,但是Redis中存贮着旧的数据。
Redis存贮的数据中带着类路径,所以JDK序列化的时候找不到这个类,就抛出Caused by: java.lang.ClassNotFoundException,把本地缓存清除一下问题解决。