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 builder.java class of the elastic search package:
Caused by: 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 com.regiocom.bpo.rcease.util.TransportClientFactory.configureClients(TransportClientFactory.java:81) at com.regiocom.bpo.rcease.util.TransportClientFactory.init(TransportClientFactory.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_102] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_102] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_102] at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_102] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:365) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:310) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133) ... 47 more Caused by: java.lang.NullPointerException at org.elasticsearch.Build.<clinit>(Build.java:49) ... 71 more

Has anybody an idea?

Thanks a lot,
Marcus

This is a known issue, we will work on a fix soon, and add testing so that this can not happen again. See https://github.com/elastic/elasticsearch/pull/21955.

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,
Marcus

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,
Marcus

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.

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

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 ?

Regards

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.

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 ?

EDIT
Also, transport-5.3.0.jar have manifest.mf present in it.

Regards

This will be fixed in Elasticsearch 5.3.1.

Thanks @jasontedor. Will wait for the release.

We added tests for this in https://github.com/elastic/elasticsearch/pull/24147 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,
Marcus

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.

1 Like

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

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