ES 5.3 and Java-API 5.3.0 > java.lang.NullPointerException?


Hello together,

i'm using the Elasticsearch 5.3.0 and my little web service uses the according java-api 5.3.0 for the connection to the ES. Therfore i've added the new maven dependency for "org.elasticsearch.client". The web service runs as a war-file with all dependencies packed as jar-files in a WilfFly 10 environment.

With the ES 2.4.1 everything worked fine, but now after the technology upgrade i'm unable to deploy my war file cause of an null pointer exception in the class of the elastic search package:
Caused by: java.lang.ExceptionInInitializerError at org.elasticsearch.common.logging.DeprecationLogger.<clinit>( at<init>( at org.elasticsearch.common.xcontent.json.JsonXContentParser.<init>( at org.elasticsearch.common.xcontent.json.JsonXContent.createParser( at org.elasticsearch.common.settings.Setting.parseableStringToList( at org.elasticsearch.common.settings.Setting.lambda$listSetting$27( at org.elasticsearch.common.settings.Setting.listSetting( at org.elasticsearch.common.settings.Setting.listSetting( at<clinit>( at org.elasticsearch.client.transport.TransportClient.newPluginService( at org.elasticsearch.client.transport.TransportClient.buildTemplate( at org.elasticsearch.client.transport.TransportClient.<init>( at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>( at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>( at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>( at com.regiocom.bpo.rcease.util.TransportClientFactory.configureClients( at com.regiocom.bpo.rcease.util.TransportClientFactory.init( at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_102] at sun.reflect.NativeMethodAccessorImpl.invoke( [rt.jar:1.8.0_102] at sun.reflect.DelegatingMethodAccessorImpl.invoke( [rt.jar:1.8.0_102] at java.lang.reflect.Method.invoke( [rt.jar:1.8.0_102] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke( at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods( at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization( ... 47 more Caused by: java.lang.NullPointerException at org.elasticsearch.Build.<clinit>( ... 71 more

Has anybody an idea?

Thanks a lot,

CDI injected/managed TransportClient fails in ElasticSearch 5.3
(Jason Tedor) #2

This is a known issue, we will work on a fix soon, and add testing so that this can not happen again. See

(Jason Tedor) #3

Also, I'm very sorry that you're running in to this.


Hello Jason,

thank you for the information and your really fast reply!
Can you estimate when the issue will be fixed?

Best regards,

Java Transport Client 5.4.1 NullPointerException
(Jason Tedor) #5

As a general policy, we do not provide dates. I think that we can get this fixed by 5.4.0, but I can not provide a date for when that will occur.


Hello Jason,

for me, it's enough to know whether it will be fixed in a bugfix version 5.3.1 or the next release. In the first case, i would wait until the next release. In the second one, i will use the ElasticSearch-Version 5.2.2.

Best regards,

(Jason Tedor) #7

I think that it's more likely that it will be fixed in the next minor release than in the next patch release, at least, that's what I'm planning on right now. I will update this thread if this changes.

(Jason Tedor) #8

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

(Kumar Ritesh Ranjan Sinha) #9

Hi @jasontedor I did not understand when you say that manifest is missing? I am running Elasticsearch with apache storm and I am getting this error. Though If I run the Elasticsearch alone it works properly. Can you please explain it ?


(Jason Tedor) #10

A jar file can be (and often is) packaged with a manifest that contains meta information about the contents of the jar. We use this to read the build info of the jar and your stack trace shows a blow up trying to read this manifest. We are trying to understand the circumstances under which this can occur as we know of situations where the jar is intact yet the runtime environment hides the manifest (application containers with special classloaders might do this). We want to make sure the fix we have in mind covers everything without introducing leniency when Elasticsearch is running as a server.

(Kumar Ritesh Ranjan Sinha) #11

Hi, @jasontedor. Thanks for the explanation. I ran this command unzip -p myjar.jar META-INF/MANIFEST.MF and I can find transport-5.3.0.jar in it along with all other jars. So, it means transport client jar is not missing. Please, can you suggest what else I should look into to make it work ?

Also, transport-5.3.0.jar have present in it.


(Jason Tedor) #12

This will be fixed in Elasticsearch 5.3.1.

(Kumar Ritesh Ranjan Sinha) #13

Thanks @jasontedor. Will wait for the release.

(Jason Tedor) #14

We added tests for this in so hopefully we never break it again.


Hello Jason,

thank you for all the information and the really quick solution. :slight_smile:
We've now upgraded our cluster to version 5.2.2 and will switch to the next minor- or major-version.

Best regards,

(Benjamin Garman) #16

Was having a similar issue with 5.4 when running within a Adobe Coldfusion 10 environment, though running from Eclipse was just fine. 5.2.2 and 5.2.3 seem to work in my environment though. I am also jumping back to 5.2.2 , for now.

(Jason Tedor) #17

Please start a separate topic with the issue that you're seeing. What's reported here was fixed in 5.4.0.

(system) #18

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