DefaultSerializer requires a Serializable payload but received an object of type...

The entity class inherits Serializable

     Student stu= null;
       ...
        redisTemplate.opsForValue().set(key+ token, stu);
        redisTemplate.expire(key+ token,expiration, TimeUnit.MILLISECONDS);

Here, if the Student class does not inherit Serializable, it will report the above error;

Guess you like

Origin www.cnblogs.com/notchangeworld/p/11907516.html