ElasticSearch NoSuchMethodError: com.google.common

ElasticSearch使用的版本是2.4.6,獲取Client報以下錯誤

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.util.concurrent.MoreExecutors.directExecutor()Ljava/util/concurrent/Executor;
    at org.elasticsearch.threadpool.ThreadPool.<clinit>(ThreadPool.java:192)
    at org.elasticsearch.client.transport.TransportClient$Builder.build(TransportClient.java:133)
    at com.linewell.ccip.utils.esclient.EsTcpClient.build(EsTcpClient.java:53)
    at com.linewell.ccip.utils.esclient.EsTcpClient.getClient(EsTcpClient.java:28)
    at com.linewell.ccip.dao.es.impl.ElasticSearchDaoImpl.main(ElasticSearchDaoImpl.java:103)

解決辦法:引入比較高的版本的guava

我用的是guava 18.0版本解決問題

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章