motan icon indicating copy to clipboard operation
motan copied to clipboard

服务端抛异常,客户端使用kryo反序列,报错missing no-arg constructor

Open Lam0923 opened this issue 4 years ago • 1 comments

使用motan,从服务端抛异常,客户端反序列化的时候报错:Caused by: com.esotericsoftware.kryo.KryoException: Class cannot be created (missing no-arg constructor): com.weibo.api.motan.exception.MotanErrorMsg Serialization trace:motanErrorMsg (com.weibo.api.motan.exception.MotanBizException) 目前定位到:MotanErrorMsg没有无参构造方法,导致反序列化报错,加上无参构造后替换jar包后正常

Lam0923 avatar Nov 09 '20 11:11 Lam0923

后续版本会考虑给MotanErrorMsg这个类添加无参构造函数。

这个问题也可以考虑通过在kryo注册对应的serializer来解决。

rayzhang0603 avatar Dec 02 '20 06:12 rayzhang0603