5.3中的Elasticsearch客户端java.lang.ExceptionInInitializerError

时间:2017-04-06 06:11:29

标签: java elasticsearch

以下代码列于TransportClient

使用elasticsearch和客户端依赖关系。

<dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch</artifactId>
    <version>5.3.0</version>
</dependency>
<dependency>
    <groupId>org.elasticsearch.client</groupId>
    <artifactId>transport</artifactId>
    <version>5.3.0</version>
</dependency>

例外:

Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.elasticsearch.common.logging.DeprecationLogger.<clinit>(DeprecationLogger.java:138)
    at org.elasticsearch.common.xcontent.support.AbstractXContentParser.<init>(AbstractXContentParser.java:57)
    at org.elasticsearch.common.xcontent.json.JsonXContentParser.<init>(JsonXContentParser.java:44)
    at org.elasticsearch.common.xcontent.json.JsonXContent.createParser(JsonXContent.java:103)
    at org.elasticsearch.common.settings.Setting.parseableStringToList(Setting.java:832)
    at org.elasticsearch.common.settings.Setting.lambda$listSetting$27(Setting.java:786)
    at org.elasticsearch.common.settings.Setting.listSetting(Setting.java:791)
    at org.elasticsearch.common.settings.Setting.listSetting(Setting.java:786)
    at org.elasticsearch.common.network.NetworkService.<clinit>(NetworkService.java:50)
    at org.elasticsearch.client.transport.TransportClient.newPluginService(TransportClient.java:98)
    at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:126)
    at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:268)
    at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:125)
    at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:111)
    at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:101)
    at xxx.test.runner.ESRunner.initESClient(ESRunner.java:120)
    at xxx.test.runner.ESRunner.inti(ESRunner.java:62)
    at xxx.test.runner.ESRunner.main(ESRunner.java:46)
Caused by: java.lang.IllegalStateException: Error finding the build shortHash. Stopping Elasticsearch now so it doesn't run in subtly broken ways. This is likely a build bug.
    at org.elasticsearch.Build.<clinit>(Build.java:62)
    ... 18 more

是否会遗漏某些依赖关系或其他内容?任何帮助表示赞赏。感谢。

1 个答案:

答案 0 :(得分:1)

我有同样的问题。改用5.2.2。问题是(至少对我而言)5.3的transportClient读取jar的清单文件是不可能的,因为应用程序在wildfly上运行(jar文件在虚拟文件系统上)