SpringBoot+Redis项目报错Invalid UTF-32 character 0x31353936

SpringBoot+Redis项目报错Invalid UTF-32 character 0x31353936
后台报错:java.io.CharConversionException: Invalid UTF-32 character 0x31353936 (above 0x0010ffff) at char #2500, byte #10003)

1、错误信息

java.io.CharConversionException: Invalid UTF-32 character 0x31353936 (above 0x0010ffff) at char #2500, byte #10003)

原因:设置过期时间时没有设置过期时间单位
解决办法:

redisTemplate.expire(ID_KEY, EXPIRE_TIME);
修改为:
redisTemplate.expire(ID_KEY, EXPIRE_TIME, TimeUnit.SECONDS);

the end

热门文章