我最近从elasticsearch 1.7升级到2.0,注意到设置客户端的方式已经改变。我查阅了文档,但不知何故客户端一直为null。请问我是否正确设置了客户端。
以下是我的代码:
以下是我的代码:
Client client = null;
try {
client = TransportClient.builder().build().addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9300));
} catch (Exception e) {
Logger.log(e);
} finally {
client.close();
try {
conn.close();
} catch (SQLException e) {
Logger.log(e);
}
}
java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;
- Daniel BuckleStackOverflowError
问题吗? - Animesh Pandey