vivo / MoonBox

月光宝盒:无侵入的流量录制与回放平台 A server-side traffic capture and replay platform with noninvasive
Apache License 2.0
1.19k stars 196 forks source link

mybaits-plus插件反序列化失败 #74

Open betagooo opened 7 months ago

betagooo commented 7 months ago

反序列化失败类:com.baomidou.mybatisplus.core.conditions.segments.MergeSegments 异常栈:

com.alibaba.jvm.sandbox.repeater.plugin.core.serialize.SerializeException: [Error-1002]-hessian-deserialize-error
    at com.alibaba.jvm.sandbox.repeater.plugin.core.serialize.HessianSerializer.deserialize(HessianSerializer.java:67)
    at com.alibaba.jvm.sandbox.repeater.plugin.core.serialize.AbstractSerializerAdapter.deserialize(AbstractSerializerAdapter.java:56)
    at com.alibaba.jvm.sandbox.repeater.plugin.core.wrapper.SerializerWrapper.inTimeDeserialize(SerializerWrapper.java:169)
    at com.vivo.jvm.sandbox.moonbox.module.MoonboxRepeaterTask.convertWrapperAndMeta(MoonboxRepeaterTask.java:198)
    at com.vivo.jvm.sandbox.moonbox.module.MoonboxRepeaterTask.lambda$pullAndDispatch$1(MoonboxRepeaterTask.java:124)
    at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: com.caucho.hessian.io.HessianFieldException: com.baomidou.mybatisplus.core.conditions.segments.MergeSegments.groupBy: expected list at java.lang.Boolean (true)
    at com.caucho.hessian.io.UnsafeDeserializer.logDeserializeError(UnsafeDeserializer.java:782)
    at com.caucho.hessian.io.UnsafeDeserializer$ObjectFieldDeserializer.deserialize(UnsafeDeserializer.java:419)
    at com.caucho.hessian.io.UnsafeDeserializer.readObject(UnsafeDeserializer.java:235)
    at com.caucho.hessian.io.UnsafeDeserializer.readObject(UnsafeDeserializer.java:146)
    at com.caucho.hessian.io.Hessian2Input.readObjectInstance(Hessian2Input.java:2227)
    at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1739)
    at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1723)
    at com.caucho.hessian.io.UnsafeDeserializer$ObjectFieldDeserializer.deserialize(UnsafeDeserializer.java:415)
    at com.caucho.hessian.io.UnsafeDeserializer.readObject(UnsafeDeserializer.java:235)
    at com.caucho.hessian.io.UnsafeDeserializer.readObject(UnsafeDeserializer.java:146)
    at com.caucho.hessian.io.Hessian2Input.readObjectInstance(Hessian2Input.java:2227)
    at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2148)
    at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2132)
    at com.caucho.hessian.io.BasicDeserializer.readLengthList(BasicDeserializer.java:599)
    at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2100)
    at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1685)
    at com.alibaba.jvm.sandbox.repeater.plugin.core.serialize.HessianSerializer.deserialize(HessianSerializer.java:64)
    ... 8 common frames omitted
Caused by: com.caucho.hessian.io.HessianProtocolException: expected list at java.lang.Boolean (true)
    at com.caucho.hessian.io.AbstractDeserializer.error(AbstractDeserializer.java:151)
    at com.caucho.hessian.io.AbstractListDeserializer.readObject(AbstractListDeserializer.java:63)
    at com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1843)
    at com.caucho.hessian.io.UnsafeDeserializer$ObjectFieldDeserializer.deserialize(UnsafeDeserializer.java:415)
    ... 23 common frames omitted

序列化时 image-20240401195318066

image-20240401183238663

反序列化时

image

image-20240401160145981

序列化时_offset=610,反序列化时:_offset=605

//先实例化
Collection list = createList();

反序列化时创建NormalSegmentList对象时,没能还原NormalSegmentList类,只是父类ArrayList,导致属性缺失,反序列化时字节流offset对应不上。

image MergeSegments类的normal、groupBy、having、orderBy属性,都是复杂的集合类。反序列化都会面临这个问题。

有大佬遇到过这个问题吗?

mxian commented 6 months ago

遇到了,现在有解决办法吗?

betagooo commented 6 months ago

遇到了,现在有解决办法吗?

弃坑了,jvm-sandbox-repeator处处遇坑。转研究arex了。

mxian commented 6 months ago

遇到了,现在有解决办法吗?

弃坑了,jvm-sandbox-repeator处处遇坑。转研究arex了。

我倒是解决这个问题了。。。现在回放成功了

betagooo commented 6 months ago

遇到了,现在有解决办法吗?

弃坑了,jvm-sandbox-repeator处处遇坑。转研究arex了。

我倒是解决这个问题了。。。现在回放成功了

恭喜~~不过我没记错的话在序列化时候其实也有丢失ISqlSegement属性。