Elasticsearch相关问题:
java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.http.netty4.Netty4HttpServerTransport
at org.elasticsearch.transport.Netty4Plugin.getSettings(Netty4Plugin.java:56)...
pom依赖相关:使用transport、elasticsearch
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>5.5.2</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>5.5.2</version>
</dependency>
或者是spring-boot-starter-data-elasticsearch时
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
原因:transport缺少netty4相关依赖
此处导入5.4.3版本
<dependency>
<groupId>org.elasticsearch.plugin</groupId>
<artifactId>transport-netty4-client</artifactId>
<version>5.4.3</version>
</dependency>
导入后就能正常启动了