2017-04-06 76 views
3

以下代碼在TransportClient上列出。Elasticsearch客戶端java.lang.ExceptionInInitializerError 5.3中的代碼

使用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

我有同樣的問題。改爲使用5.2.2。問題是(至少對我來說)5.3的transportClient讀取jar文件的清單文件,這是不可能的,因爲應用程序在wildfly上運行(jar文件在虛擬文件系統上)

+0

Down grading to 5.2 .2停止了例外,但現在遇到了其他問題。感謝您的建議。 – watts