java跟踪弹_使用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.(MultithreadEventExecutorGroup.java:84)

at io.netty.util.concurrent.MultithreadEventExecutorGroup.(MultithreadEventExecutorGroup.java:58)

at io.netty.util.concurrent.MultithreadEventExecutorGroup.(MultithreadEventExecutorGroup.java:47)

at io.netty.channel.MultithreadEventLoopGroup.(MultithreadEventLoopGroup.java:49)

我的pom.xml是

org.elasticsearch.client

transport

5.2.1

org.apache.logging.log4j

log4j-core

2.6.2

请提前帮助谢谢

解决方法:

我猜这可能是因为在将弹性搜索版本从低于2.4的版本升级到当前版本时,您的实现发生了变化.

TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)

.addTransportAddress(new InetSocketTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9200));

虽然在Version 2.3之前和之前的实施如下:

Client client = TransportClient.builder().build()

.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("host1"), 9300))

.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("host2"), 9300));

Thrown when an application tries to call an abstract method. Normally,

this error is caught by the compiler; this error can only occur at run

time if the definition of some class has incompatibly changed since

the currently executing method was last compiled.

我也建议你,通过mvn依赖:树并排除工件org.elasticsearch.client的任何其他依赖项.

标签:java,elasticsearch

来源: https://codeday.me/bug/20190623/1265828.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值