springBoot2.0+elasticsearch6.3 整合报错信息

新建微服务项目时,没有加载依赖包,直接复制官网MAVEN地址过来,各种包不兼容,冲突之后启动报错

直接抛出异常,包名冲突

Exception in thread "elasticsearch[elasticsearch][management][T#1]" java.lang.AbstractMethodError: org.elasticsearch.transport.TcpTransport.sendMessage(Ljava/lang/Object;Lorg/elasticsearch/common/bytes/BytesReference;Ljava/lang/Runnable;)V
	at org.elasticsearch.transport.TcpTransport.internalSendMessage(TcpTransport.java:1111)
	at org.elasticsearch.transport.TcpTransport.sendRequestToChannel(TcpTransport.java:1093)
	at org.elasticsearch.transport.TcpTransport.executeHandshake(TcpTransport.java:1600)
	at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:568)
	at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:114)
	at org.elasticsearch.transport.TransportService.openConnection(TransportService.java:351)
	at org.elasticsearch.client.transport.TransportClientNodesService$SniffNodesSampler$1.doRun(TransportClientNodesService.java:506)
	at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:638)
	at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
	

解决方案  对应的版本号,排队没必要的版本,之前是5.6版本,主要看transport-netty4-client这个,下面是完整导入就正常了

	
	 
	org.elasticsearch 
	elasticsearch 
	6.3.0
	 
	 
	org.elasticsearch.client 
	transport 
	6.3.0 
	 
	 
	org.elasticsearch.plugin 
	transport-netty4-client 
	 
	 
	 
	 
	org.elasticsearch.plugin 
	transport-netty4-client 
	6.3.0
	
	

   主要是下面这两个包,在仓库里找下,看是不是跟elasticsearch版本一样,否则通信出错

   transport-netty4-client\6.3.0\transport-netty4-client-6.3.0.jar
   
    transport-netty3-client\5.6.2\transport-netty3-client-5.6.2.jar
    

 

错误 二,单纯的spingBoot 项目, 启动报错

Unregistering JMX-exposed beans on shutdown

没有加载依赖web 包的原因,只做微服务写后台, 应该可以不加载web 依赖包,那就加上,重启一切OK

		    
            org.springframework.boot  
            spring-boot-starter-web  
         

 

你可能感兴趣的:(elasticsearch,springboot)