# Refuse Connection using docker and Java Library

**URL:** <https://discuss.elastic.co/t/refuse-connection-using-docker-and-java-library/75175>\
**Category:** Elasticsearch\
**Created:** [February 15, 2017, 10:42am UTC](https://discuss.elastic.co/t/refuse-connection-using-docker-and-java-library/75175 "2017-02-15T10:42:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Otavio\_Goncalves\_de1](https://avatars.discourse-cdn.com/v4/letter/o/bb73d2/32.png) [@Otavio\_Goncalves\_de1](https://discuss.elastic.co/u/Otavio_Goncalves_de1)\
**Post date:** [February 15, 2017, 10:42am UTC](https://discuss.elastic.co/t/refuse-connection-using-docker-and-java-library/75175/1 "2017-02-15T10:42:30Z")

</div>

On docker I ran the command: "docker run --name elasticsearch-instance -p 9300:9300 -p 9200:9200 -d elasticsearch"

And then I tried to connect using the Java Driver to do a small test.

But it returns an error for refused connection:

NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{ZMxWNaY-QPKf9YCkpnRRqw}{localhost}{127.0.0.1:9300}]  
]  
at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:328)  
at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:226)  
at org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:59)  
at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:345)  
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:403)  
at org.elasticsearch.client.support.AbstractClient$IndicesAdmin.execute(AbstractClient.java:1226)  
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:80)  
at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:54)

I have tried some parameters such as  
-Des.network.host=0.0.0.0 and -Des.network.host=0.0.0.0 but without sucess.

p.s: I did the same test downloading and then run ES manually and the code works

---

<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:** [March 15, 2017, 10:42am UTC](https://discuss.elastic.co/t/refuse-connection-using-docker-and-java-library/75175/2 "2017-03-15T10:42:46Z")

</div>

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