gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:50:46 24 4
gpt4 key购买 nike

以下代码在 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):

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

它可能缺少一些依赖性,还是其他什么?任何帮助表示赞赏。谢谢。

最佳答案

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

关于java - 5.3 中的 Elasticsearch 客户端 java.lang.ExceptionInInitializerError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43247052/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com