Unexpected error occurred in scheduled task. org.springframework.data.redis.serializer.SerializationException: Could not read JSON: Unrecognized field "spxQrCodeUrl" (class org.springblade.modules.lyweb.vo.LyWebDeviceGroupVO), not marked as ignorable (50 known properties: "imgCouponPrice", "soThreeOvertimeVideoNumber", "giveOriginal", "byTime", "imgPrice", "speed", "videoCouponPrice", "havaNotPush", "pointsNumber", "douYinQrCodeUrl", "cron", "splitProportionId", "deviceSort", "synthesisMode", "isEnableSynthesisTimeout", "id", "email", "isOnline", "videClipId", "qrCodeUrl", "flashMobPhoto", "soThreeOvertime", "videoNumber", "tenantId", "triggerModeName", "ghostCover", "groupName", "isBody", "synthesisTimeout", "phone", "isComplement", "giveImg", "remarks", "region", "termOfValidity", "centerAtlas", "originalPrice", "repeatSynthesis", "triggerMode", "simpleCount", "scenicName", "videoSynthesisNumber", "centerPhotoWall", "bodyTime", "giveLikeSwitch", "unitPrice", "giveVideo", "originalCouponPrice", "singleDeduction", "whiteBoardQrCodeUrl"]) 错误分析
时间: 2023-07-23 08:14:37 浏览: 203
PHP错误Parse error: syntax error, unexpected end of file in test.php on line 12解决方法
根据错误信息,看起来是在执行定时任务时发生了异常。具体的异常信息是`org.springframework.data.redis.serializer.SerializationException: Could not read JSON: Unrecognized field "spxQrCodeUrl" (class org.springblade.modules.lyweb.vo.LyWebDeviceGroupVO), not marked as ignorable`。
这个异常是由Redis序列化过程中出现的问题引起的。根据错误信息,`LyWebDeviceGroupVO`类中的字段`spxQrCodeUrl`无法被识别,而且该字段没有被标记为可忽略的字段。
可能的原因是对象在序列化或反序列化过程中发生了变化,而Redis中存储的数据仍然保留了旧版本对象的字段。当从Redis中读取数据并尝试反序列化为新版本对象时,就会出现字段不匹配的问题。
解决这个问题的方法是更新Redis中存储的数据,使其与新版本对象的字段匹配。或者,您可以考虑在对象的字段上添加`@JsonIgnoreProperties(ignoreUnknown = true)`注解,以忽略未知字段的反序列化错误。这样,即使Redis中存储的数据包含有新版本对象没有的字段,也不会引发反序列化异常。
阅读全文