# 6.0.0: NullPointerException at org.elasticsearch.Build.\<clinit\>(Build.java:49)

**URL:** <https://discuss.elastic.co/t/6-0-0-nullpointerexception-at-org-elasticsearch-build-clinit-build-java-49/110142>\
**Category:** Elasticsearch\
**Created:** [December 4, 2017, 12:30pm UTC](https://discuss.elastic.co/t/6-0-0-nullpointerexception-at-org-elasticsearch-build-clinit-build-java-49/110142 "2017-12-04T12:30:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joel\_Becker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joel_becker/32/24991_2.png) [@Joel\_Becker](https://discuss.elastic.co/u/Joel_Becker)\
**Post date:** [December 4, 2017, 12:30pm UTC](https://discuss.elastic.co/t/6-0-0-nullpointerexception-at-org-elasticsearch-build-clinit-build-java-49/110142/1 "2017-12-04T12:30:23Z")

</div>

Hi, I'm trying to use the High Level Java REST client version 6.0.0, in an IntelliJ plugin that I'm developing, but my progress is blocked, because when trying to create an instance of RestHighLevelClient, I get

java.lang.ExceptionInInitializerError....Caused by: java.lang.NullPointerException at org.elasticsearch.Build.(Build.java:49). My scala code:

```
  _elastic = new RestHighLevelClient(
    RestClient.builder(
      new HttpHost("localhost", 9300, "http")))

```

Stack trace:

java.lang.ExceptionInInitializerError  
at org.elasticsearch.common.logging.DeprecationLogger.(DeprecationLogger.java:163)  
at org.elasticsearch.common.ParseField.(ParseField.java:35)  
at org.elasticsearch.client.RestHighLevelClient.lambda$getDefaultNamedXContents$46(RestHighLevelClient.java:612)  
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)  
at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1691)  
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)  
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)  
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)  
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)  
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)  
at org.elasticsearch.client.RestHighLevelClient.getDefaultNamedXContents(RestHighLevelClient.java:613)  
at org.elasticsearch.client.RestHighLevelClient.(RestHighLevelClient.java:207)  
at org.elasticsearch.client.RestHighLevelClient.(RestHighLevelClient.java:192)  
at org.elasticsearch.client.RestHighLevelClient.(RestHighLevelClient.java:184)  
at [my plugin's stack]  
at com.intellij.openapi.application.TransactionGuardImpl$6.run(TransactionGuardImpl.java:291)  
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:326)  
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:310)  
... [More IntelliJ/AWT stack]  
Caused by: java.lang.NullPointerException  
at org.elasticsearch.Build.(Build.java:49)  
... 117 more

My best guess is it has to do with weird class loader situations, as was the case with the [problem reported using it with Jetty](https://discuss.elastic.co/t/nullpointerexception-build-java-48/107830/2) ? I know IntelliJ plugins get their own class loader...

Any workaround in the meantime?

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [December 4, 2017, 4:54pm UTC](https://discuss.elastic.co/t/6-0-0-nullpointerexception-at-org-elasticsearch-build-clinit-build-java-49/110142/2 "2017-12-04T16:54:02Z")

</div>

Are you sure that is the complete stack trace? Your thread title mentions Build, but your stack trace does not.

---

<div class="post-metadata">

**Author:** ![Joel\_Becker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joel_becker/32/24991_2.png) [@Joel\_Becker](https://discuss.elastic.co/u/Joel_Becker)\
**Post date:** [December 4, 2017, 5:51pm UTC](https://discuss.elastic.co/t/6-0-0-nullpointerexception-at-org-elasticsearch-build-clinit-build-java-49/110142/3 "2017-12-04T17:51:51Z")

</div>

Sorry, forgot to include the "caused by" part which was a NullPointerException. It listed just line 49 in RestClient iirc. I can copy/paste it later when I have access to the project again...

---

<div class="post-metadata">

**Author:** ![Joel\_Becker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joel_becker/32/24991_2.png) [@Joel\_Becker](https://discuss.elastic.co/u/Joel_Becker)\
**Post date:** [December 5, 2017, 1:52am UTC](https://discuss.elastic.co/t/6-0-0-nullpointerexception-at-org-elasticsearch-build-clinit-build-java-49/110142/4 "2017-12-05T01:52:05Z")

</div>

I updated the stack trace in the original post. thanks!

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [December 5, 2017, 5:13am UTC](https://discuss.elastic.co/t/6-0-0-nullpointerexception-at-org-elasticsearch-build-clinit-build-java-49/110142/5 "2017-12-05T05:13:20Z")

</div>

This issue has been [fixed](https://github.com/elastic/elasticsearch/commit/eefa4dff5905fe0a1fcf126e342268af9d4d8bd1) on the 6.0 branch, and should be resolved in the next patch release of 6.0

I don't have any immediate work around for you (short of building your own snapshot from the git branch), but I'm confident we'll have a fixed version available in the not-too-distant future.

---

<div class="post-metadata">

**Author:** ![Joel\_Becker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joel_becker/32/24991_2.png) [@Joel\_Becker](https://discuss.elastic.co/u/Joel_Becker)\
**Post date:** [December 5, 2017, 5:48pm UTC](https://discuss.elastic.co/t/6-0-0-nullpointerexception-at-org-elasticsearch-build-clinit-build-java-49/110142/6 "2017-12-05T17:48:39Z")

</div>

Awesome, thanks!

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [December 7, 2017, 4:23am UTC](https://discuss.elastic.co/t/6-0-0-nullpointerexception-at-org-elasticsearch-build-clinit-build-java-49/110142/7 "2017-12-07T04:23:14Z")

</div>

This fix is available in 6.0.1 now.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 4, 2018, 4:23am UTC](https://discuss.elastic.co/t/6-0-0-nullpointerexception-at-org-elasticsearch-build-clinit-build-java-49/110142/8 "2018-01-04T04:23:27Z")

</div>

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