ER_UNKNOW:com.esotericsoftware.kryo.KryoException: Class cannot be created (missing no-arg construct

时间:2024-05-22 10:28:25

自己报的是这个异常 (这个内部集合类没有无参构造)
ER_UNKNOW:com.esotericsoftware.kryo.KryoException: Class cannot be created (missing no-arg constructor): java.util.Arrays$ArrayList
Serialization trace: returnDataList (com.engine.modules.trade.model.Trade)
问题:
是因为我这块的 returnDataList使用的是 Arrays.asList() 方法将数组转换为集合,这个方法转换成的集合对象会引起序列化异常
ER_UNKNOW:com.esotericsoftware.kryo.KryoException: Class cannot be created (missing no-arg construct
因为2个集合对象不是一样的
ER_UNKNOW:com.esotericsoftware.kryo.KryoException: Class cannot be created (missing no-arg construct
解决:
第一张图片里面有:
创建新集合,循环遍历数据,将数组里的数据放入集合