CDI injected/managed TransportClient fails in ElasticSearch 5.3

Is using CDI to inject and manage the creation of TransportClient instances supported in 5.3? In 5.2.2 I was able to use a CDI producer method to @Inject a PreBuiltTransportClient instance with no issues. As of 5.3 this blows up with:

Caused by: java.lang.ExceptionInInitializerError
at org.elasticsearch.common.logging.DeprecationLogger.(DeprecationLogger.java:138)
at org.elasticsearch.common.xcontent.support.AbstractXContentParser.(AbstractXContentParser.java:57)
at org.elasticsearch.common.xcontent.json.JsonXContentParser.(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$$Lambda$168/105203394.apply(Unknown Source)
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.(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.(TransportClient.java:268)
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:125)
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:111)
at org.elasticsearch.transport.client.PreBuiltTransportClient.(PreBuiltTransportClient.java:101)
at com.pixelslanger.px.strains.search.elasticsearch.TransportClientFactory.getTransportClient(TransportClientFactory.java:43)
Caused by: java.lang.NullPointerException
at org.elasticsearch.Build.(Build.java:49)
... 99 more

This is a known issue: ES 5.3 and Java-API 5.3.0 > java.lang.NullPointerException?

Also, as I said on the other issue, and I'll say the same to you: I'm really sorry that you ran into this issue.

No worries, and thanks for the quick response.

Have you repackaged the transport client jar? It looks here like the manifest is missing?

No I didn't do any repackaging of any JARs I simply upgraded from 5.2.2 to 5.3.0 via Maven. I just double checked and the manifest file is present in the 5.3.0 JAR.

Okay, so I think is indeed a case of how Wildfly handles class loading. Thanks for confirming.

This will be fixed in Elasticsearch 5.3.1.

Nice! Thanks

We added tests for this in https://github.com/elastic/elasticsearch/pull/24147 so hopefully we never break it again.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.