我收到以下错误:
堆栈跟踪:
线程中的异常" main" java.lang.NoSuchMethodError:io.netty.buffer.CompositeByteBuf.addComponents(ZLjava / lang / Iterable;)Lio / netty / buffer / CompositeByteBuf; 在org.elasticsearch.transport.netty4.Netty4Utils.toByteBuf(Netty4Utils.java:117) at org.elasticsearch.transport.netty4.Netty4Transport.sendMessage(Netty4Transport.java:395) at org.elasticsearch.transport.netty4.Netty4Transport.sendMessage(Netty4Transport.java:94) at org.elasticsearch.transport.TcpTransport.internalSendMessage(TcpTransport.java:1125) at org.elasticsearch.transport.TcpTransport.sendRequestToChannel(TcpTransport.java:1107) at org.elasticsearch.transport.TcpTransport.executeHandshake(TcpTransport.java:1622) at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:556) 在org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:117) at org.elasticsearch.transport.TransportService.openConnection(TransportService.java:334) at org.elasticsearch.client.transport.TransportClientNodesService $ SimpleNodeSampler.doSample(TransportClientNodesService.java:408) at org.elasticsearch.client.transport.TransportClientNodesService $ NodeSampler.sample(TransportClientNodesService.java:358) at org.elasticsearch.client.transport.TransportClientNodesService.addTransportAddresses(TransportClientNodesService.java:199) at org.elasticsearch.client.transport.TransportClient.addTransportAddress(TransportClient.java:322)
我使用ES:5.4.2和Lucene:6.5.1和netty-all 4.0.9,netty buffer 4.1.11和netty-common 4.1.11 jars
Settings settings =Settings.builder().put("cluster.name", "my-application").build();
TransportClient client = new PreBuiltTransportClient(settings);
TransportAddress address = new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9300);
client.addTransportAddress(address);