[apache/dubbo]hessian序列化:增加对jdk1.8新增的时间类型的支持

2024-05-30 465 views
4

1.hessian序列化:增加对jdk1.8新增的时间类型的支持: 在hessian序列化java新增时间类型时,会由于死循环而报:StackOverflowError:

java.lang.StackOverflowError
    at java.lang.ReflectiveOperationException.<init>(ReflectiveOperationException.java:89)
    at java.lang.reflect.InvocationTargetException.<init>(InvocationTargetException.java:72)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.alibaba.com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:199)
    at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:408)
    at com.alibaba.com.caucho.hessian.io.JavaSerializer$FieldSerializer.serialize(JavaSerializer.java:313)
    at com.alibaba.com.caucho.hessian.io.JavaSerializer.writeInstance(JavaSerializer.java:263)
    at com.alibaba.com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:227)
    at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:408)
    at com.alibaba.com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:203)
    at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:408)
    at com.alibaba.com.caucho.hessian.io.JavaSerializer$FieldSerializer.serialize(JavaSerializer.java:313)
    at com.alibaba.com.caucho.hessian.io.JavaSerializer.writeInstance(JavaSerializer.java:263)
    at com.alibaba.com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:227)
    at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:408)
    at com.alibaba.com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:203)
    at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:408)
    at com.alibaba.com.caucho.hessian.io.JavaSerializer$FieldSerializer.serialize(JavaSerializer.java:313)
    at com.alibaba.com.caucho.hessian.io.JavaSerializer.writeInstance(JavaSerializer.java:263)
    at com.alibaba.com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:227)
    at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:408)
    at com.alibaba.com.caucho.hessian.io.JavaSerializer.writeObject(JavaSerializer.java:203)
    at com.alibaba.com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:408)
    at com.alibaba.com.caucho.hessian.io.JavaSerializer$FieldSerializer.serialize(JavaSerializer.java:313)

...................................

  1. 修复几个bug

回答

2

这个PR有发布计划吗?

1

这个项目感觉N年没动过了,PR还有人处理吗?

2

1.这个PR貌似提交了很多内容 2.hessian-lite是dubbo内部源码维护版本,且是rpc序列化核心组件,hessian部分的改动请仔细斟酌

1

manually merge the change with commits: c5c017dcba089d8b4c7e7e42b51cd2664194c138, 5526dd8d2e80741e311e5466fc24392b2421eb00, 2d274ec8a36ceb9a85a60fc838affc88e99f8371, 7a0731b0562b6e0930e1ec6e96e65133e78f6079

1

@zgmzyr 能不能具体描述一下hessian序列化jdk1.8新增时间类型时遇到的问题?序列化哪个类,报了什么异常? 1.现在我测试了几个类并没有发现问题,我不明白为什么这么多jdk时间类型都要这么改 2.如果按照你提供的方式来修改的话,是能正常完成序列化,但升级的过程中consumer、provider端会存在兼容性问题,是需要提醒业务方注意的增加升级成本

9

java8的LoalDateTime ZonedDateTime等是会报以上错误,是我用的新版本才没报错。