Connecting to Elasticsearch in an executable jar

Hello,

We recently upgraded from Elasticsearch 2x to 5.3.3. We have created executable jars that will load data into Elastic search. The jars worked fine in 2x but do not work in 5.3.3. We are getting the error: "Error finding the build shortHash.
Stopping Elasticsearch now so it doesn't run in subtly broken ways". From researching the issue seems that connecting to elasticsearch from with in an executable jar is no longer supported. Is this the case? So the following code will no longer work in a jar?

Client client = new PreBuiltTransportClient(Settings.EMPTY)
                 .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9300));

If this is the case is there a better way to ingest a large (50k) dataset into Elasticsearch without using the rest service?

Thanks.

So the following code will no longer work in a jar?

It should work. I mean that I've using that for some time (I now switched to REST client) but it has always been working.

From researching the issue seems that connecting to elasticsearch from with in an executable jar is no longer supported.

Do you have any link?

I have the same problem when I am using Elasticsearch 5.3.0. You can see my problem here.

I try to change the Elasticsearch's dependency from 5.3.0 to 5.5.2, and it finally solve the problem. In fact you should keep the same version on both sides, this is really a rude way.

So now I am using ES 5.6.3 with REST Client and never meet such problem. You can try the latest version if possible.

1 Like

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