# Integrating elasticsearch with java through TransportClient

**URL:** <https://discuss.elastic.co/t/integrating-elasticsearch-with-java-through-transportclient/100190>\
**Category:** Elasticsearch\
**Created:** [September 12, 2017, 10:01am UTC](https://discuss.elastic.co/t/integrating-elasticsearch-with-java-through-transportclient/100190 "2017-09-12T10:01:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaibhav2903](https://avatars.discourse-cdn.com/v4/letter/v/a9a28c/32.png) [@vaibhav2903](https://discuss.elastic.co/u/vaibhav2903)\
**Post date:** [September 12, 2017, 10:01am UTC](https://discuss.elastic.co/t/integrating-elasticsearch-with-java-through-transportclient/100190/1 "2017-09-12T10:01:41Z")

</div>

I am trying to connect Eclipse(Java) with elasticsearch using transportclient.  
i am unable to connect both of them because of the following error:

I have used logstash to connect mysqlWorkbench with elasticsearch.

TransportClientNodesService - failed to connect to node [{#transport#-1}{yIoU2HxxSH-6Lz41uLkvNQ}{localhost}{127.0.0.1:9200}], ignoring...  
org.elasticsearch.transport.ConnectTransportException: [][127.0.0.1:9200] handshake\_timeout[30s]  
at org.elasticsearch.transport.TcpTransport.executeHandshake(TcpTransport.java:1614) ~[elasticsearch-5.5.2.jar:5.5.2]  
at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:555) ~[elasticsearch-5.5.2.jar:5.5.2]  
at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:116) ~[elasticsearch-5.5.2.jar:5.5.2]  
at org.elasticsearch.transport.TransportService.openConnection(TransportService.java:351) ~[elasticsearch-5.5.2.jar:5.5.2]  
at org.elasticsearch.client.transport.TransportClientNodesService$SimpleNodeSampler.doSample(TransportClientNodesService.java:407) [elasticsearch-5.5.2.jar:5.5.2]  
at org.elasticsearch.client.transport.TransportClientNodesService$NodeSampler.sample(TransportClientNodesService.java:357) [elasticsearch-5.5.2.jar:5.5.2]  
at org.elasticsearch.client.transport.TransportClientNodesService.addTransportAddresses(TransportClientNodesService.java:198) [elasticsearch-5.5.2.jar:5.5.2]  
at org.elasticsearch.client.transport.TransportClient.addTransportAddress(TransportClient.java:319) [elasticsearch-5.5.2.jar:5.5.2]  
at com.p2s.dao.PersonDAO.ElasticsearchTC(PersonDAO.java:243) [classes/:?]  
at com.p2s.service.MainService.getAllDetails(MainService.java:51) [classes/:?]  
at com.p2s.controllers.MainController.getAllDetailsC(MainController.java:71) [classes/:?]  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0\_131]  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~  
....

---

<div class="post-metadata">

**Author:** ![vaibhav2903](https://avatars.discourse-cdn.com/v4/letter/v/a9a28c/32.png) [@vaibhav2903](https://discuss.elastic.co/u/vaibhav2903)\
**Post date:** [September 12, 2017, 11:34am UTC](https://discuss.elastic.co/t/integrating-elasticsearch-with-java-through-transportclient/100190/2 "2017-09-12T11:34:21Z")

</div>

This issue has been solved here.

> <https://stackoverflow.com/questions/46173884/using-elasticsearch-in-java-through-transportclient/46174694#46174694>

---

<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:** [October 10, 2017, 11:34am UTC](https://discuss.elastic.co/t/integrating-elasticsearch-with-java-through-transportclient/100190/3 "2017-10-10T11:34:22Z")

</div>

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