Serializing an arbitrary Java object with Kryo (getting IllegalAccessError)

前端 未结 2 1310
小鲜肉
小鲜肉 2021-01-19 15:47

Motivation:

To aid in remote debugging (Java), it\'s useful to be able to request remote servers to send over arbitrary objects to my local machine for inspection.

2条回答
  •  情深已故
    2021-01-19 16:30

    This error is pretty common with Kryo. Problem is that UTF_8 class is not public and hence Kryo fails. Adding below custom serializer helped me to resolve it. It would be a good idea to ship below kind of serializer along with Kryo as lot of people struggles with this.

    Custom serializer for kryo for UTF-8 and other charsets

    This way you are telling Kryo that for all registered Charset classes, call my custom serializer. Where I am just emitting string name.

提交回复
热议问题