我是一只咸鱼

导航

kryo高速序列化坑,springboot版本是2.2.1.RELEASE

可能是版本号不对应(我是用的springboot版本是2.2.1.RELEASE),在使用

<dependency>
    <groupId>de.javakaffee</groupId>
    <artifactId>kryo-serializers</artifactId>
    <version>0.45</version>
</dependency>

的时候服务提供者和消费者必须增加以下依赖:
<dependency>
    <groupId>com.esotericsoftware</groupId>
    <artifactId>kryo</artifactId>
    <version>4.0.2</version>
</dependency>

否则会报错:

Caused by: com.alibaba.dubbo.remoting.RemotingException: Failed to send message Request
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.dubbo.common.serialize.kryo.utils.KryoUtils

 

posted on 2019-11-26 23:10  我是一只咸鱼  阅读(1536)  评论(0编辑  收藏  举报