我試圖連接到彈性搜索這個樣子,彈性搜索與Java
Transport client = new PreBuiltTransportClient(Settings.EMPTY).
addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9200));
但我收到以下錯誤,當我運行: -
Exception in thread "main" java.lang.AbstractMethodError: io.netty.util.concurrent.MultithreadEventExecutorGroup.newChild(Ljava/util/concurrent/Executor;[Ljava/lang/Object;)Lio/netty/util/concurrent/EventExecutor;
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:84)
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:58)
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:47)
at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:49)
我的pom.xml的是
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>5.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.6.2</version>
</dependency>
請幫助提前致謝
感謝exluding io.netty:網狀-comman解決@PrashantKumar歡迎:) –
,甚至沒有注意到這一點。 +1投票給你,我更新了我的答案,以避免混淆。 – nullpointer