Springboot2.0 集成 Elasticsearch 6.x 未添加 transport-netty4-client 依赖 启动时报错

报错内容关键部分:

Failed to instantiate [org.elasticsearch.client.transport.TransportClient]: Factory method 'transportClient' threw exception; nested exception is java.lang.NoClassDefFoundError: org/elasticsearch/common/transport/InetSocketTransportAddress

解决方法,添加依赖 transport-netty4-client Maven依赖:

<dependency>
    <groupId>org.elasticsearch.plugin</groupId>
    <artifactId>transport-netty4-client</artifactId>
    <version>6.2.3</version>
</dependency>

版本号根据elasticsearch的版本号做相应改变

猜你喜欢

转载自blog.csdn.net/weixin_41846320/article/details/81240807