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;