ES 5.2 : Java client hangs on new PreBuiltTransportClient

I have an instance ES 5.2 local. I tried connect to the ES node using TransportClient but not sucess. The java client hangs on this command: TransportClient client = new PreBuiltTransportClient

Here is the code
Settings settings = Settings.builder().put("cluster.name", "my-elasticsearch-cluster-name").build();
//TransportClient client = new PreBuiltTransportClient(settings);
TransportClient client = new PreBuiltTransportClient(Settings.EMPTY);
System.out.println("Start client");
this.client = client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(endPoint), port));

Am I missing somethings? Why is there no error messages but the Client hangs forever? Could the error be somewhere else?

Thank you!

1 Like

Hello,
Has anyone run into the same problem? PLs share your solutions...
I have no problem with my old cluster 1.x but this new ES 5.2 gives this error!!

Thank you,

Having exactly the same issue with 5.1 client & server. Would appreciate any insight on what can be happening.

Please take a stack dump of the process when it's hung (use jstack) in the constructor and share it here.

You need to make sure you have downloaded the dependencies for the PreBuiltTransportClient.

http://search.maven.org/#search|ga|1|org.elasticsearch.plugin

percolator-client
lang-mustache-client
reindex-client
transport-netty4-client
transport-netty3-client

Pay attention to the release you have.

Dave

I've solved mine by adding these 2 dependencies to my build.gradle

compile "org.apache.logging.log4j:log4j-api:2.8"
compile "org.apache.logging.log4j:log4j-core:2.8"
1 Like

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