redisson get()数据报错,missing type id property ‘@class’

redisson get()数据报错:

com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Missing type id when trying to resolve subtype of [simple type, class java.lang.Object]: missing type id property ‘@class’

详细报错信息如下:
com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Missing type id when trying to resolve subtype of [simple type, class java.lang.Object]: missing type id property '@class'
xxxx
xxxx
[ERROR] 2021-11-29 17:52:59.114 [redisson-netty-2-11] ErrorsLoggingHandler.exceptionCaught(47) - Exception occured. Channel: [id: 0x14385c74, L:/172.16.101.17:60939 - R:xxx.201.34.xxx/xxx.201.34.2xx:6379]
io.netty.handler.codec.DecoderException: com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Missing type id when trying to resolve subtype of [simple type, class java.lang.Object]: missing type id property '@class'
 at [Source: (io.netty.buffer.ByteBufInputStream); line: 1, column: 104]
xxx
xxx
Caused by: com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Missing type id when trying to resolve subtype of [simple type, class java.lang.Object]: missing type id property '@class'
报错原因:

json序列化转换失败,找不到名为“@class”的property

1. 解决方法一:

① 在实体类上添加注解:

@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS,include = JsonTypeInfo.As.PROPERTY,property = "@class")

② 添加无参构造方法
③ 删除redis数据,重试

2. 解决方法二:

① 修改序列化器,支持以下序列化器,java的序列化使用SerializationCodeclQLPDhrpxJZNoprNBBTNApSwT2YQW1oT7q0BrD-HKUBIAA_660_1044.png_720x720g

② 实体类实现 Serializable 接口,添加serialVersionUID属性。
③ 删除redis数据,重试

### DCEVM Error 'Could Not Get DCEVersion' Solution When encountering the issue where DCEVM (Dynamic Code Evolution Virtual Machine) fails to retrieve the `DCEVersion`, this typically indicates an inconsistency or misconfiguration within the environment setup. The following considerations provide insight into resolving such issues: One possible reason is related to how dependency management interacts with specific versions of projects being tracked. If tracking one project's version explicitly, using exclusion mechanisms might make sense; however, selecting a particular version requires updating all associated dependencies accordingly during upgrades[^1]. This ensures compatibility between components. Additionally, while unrelated directly but indicative of managing complex configurations involving multiple formats like CSV files—tools mentioned include Jackson extensions for handling structured data efficiently through frameworks such as OpenCSV, Super CSV, UniVocity Parsers among others[^2], these could indirectly assist by ensuring robust configuration parsing without errors affecting overall system stability including JVM-based applications utilizing DCEVM features. To address specifically: - Verify correct installation paths. - Confirm matching JDK/JRE versions supported by current DCEVM release notes provided officially from its repository sources. - Ensure no conflicting modules interfere at runtime causing classloading discrepancies leading up to missing property exceptions regarding expected properties (`dceversion`). Here’s example code demonstrating basic troubleshooting steps programmatically checking presence before proceeding further actions based upon detected conditions inside application logic flow contextually relevant hereafter assuming java language syntax applicable given scenario described above : ```java public static void main(String[] args){ String dceVersion = System.getProperty("sun.java.command"); // Hypothetical placeholder method call if(dceVersion == null || dceVersion.isEmpty()){ throw new RuntimeException("Error: Could not get DCEVersion."); }else{ System.out.println("Detected DCE Version:" + dceVersion); } } ```
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

了迹奇有没

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值