# "org.elasticsearch.transport.ConnectTransportException" can't able to caught in java application

**URL:** <https://discuss.elastic.co/t/org-elasticsearch-transport-connecttransportexception-cant-able-to-caught-in-java-application/13100>\
**Category:** Elasticsearch\
**Created:** [August 7, 2013, 7:54am UTC](https://discuss.elastic.co/t/org-elasticsearch-transport-connecttransportexception-cant-able-to-caught-in-java-application/13100 "2013-08-07T07:54:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammad\_rafi\_g](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@mohammad\_rafi\_g](https://discuss.elastic.co/u/mohammad_rafi_g)\
**Post date:** [August 7, 2013, 7:54am UTC](https://discuss.elastic.co/t/org-elasticsearch-transport-connecttransportexception-cant-able-to-caught-in-java-application/13100/1 "2013-08-07T07:54:45Z")

</div>

Hi to All,  
We have 4 nodes[1 Master Node+1 client Node + 2 Data Nodes] and  
the settings of each node is:  
each node heap size is 5gb["ES\_MIN\_MEM" and "ES\_MAX\_MEM" are  
5gb]  
and in elasticsearch.yml file  
bootstrap.mlockall: true  
index.store.compress.stored: true  
index.refresh\_interval: 20s  
indices.memory.index\_buffer\_size: 50%  
index.translog.flush\_threshold\_ops: 50000  
threadpool.bulk.type: fixed  
threadpool.bulk.size: 90

```
     The 4 nodes are running under same cluster, and every thing is 

```

working fine for bulk loading. But  
When we are trying to query the elasticsearch data, while a bulk  
loading happening in background, one node got down out of 4 nodes. and we  
got the following Exception at java application log file.,  
................................................................................................................................................................  
05.08.2013 18:18:00 DEBUG (Log4jESLogger.java:99) - [Thing] failed to  
connect to node [[#transport#-3][inet[/10.14.133.89:9313]]], removed from  
nodes list  
org.elasticsearch.transport.ConnectTransportException:  
[][inet[/10.14.133.89:9313]] connect\_timeout[30s]  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToChannels(NettyTransport.java:683)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:604)  
at  
org.elasticsearch.transport.netty.NettyTransport.connectToNode(NettyTransport.java:574)  
at  
org.elasticsearch.transport.TransportService.connectToNode(TransportService.java:127)  
at  
org.elasticsearch.client.transport.TransportClientNodesService$SimpleNodeSampler.sample(TransportClientNodesService.java:302)  
at  
org.elasticsearch.client.transport.TransportClientNodesService$ScheduledNodeSampler.run(TransportClientNodesService.java:281)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
at java.lang.Thread.run(Unknown Source)  
Caused by: java.net.ConnectException: connection timed out  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.processConnectTimeout(NioClientBoss.java:136)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.process(NioClientBoss.java:82)  
at  
org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312)  
at  
org.elasticsearch.common.netty.channel.socket.nio.NioClientBoss.run(NioClientBoss.java:41)  
at  
org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)  
at  
org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)  
... 3 more  
................................................................................................................................................................  
And at elasticsearch logs we found the following...  
at Data Node: "java.lang.OutOfMemoryError: Java heap space" and  
" java.io.StreamCorruptedException"  
at Master Node:  
"org.elasticsearch.transport.NodeDisconnectedException",

"org.elasticsearch.indices.IndexMissingException: [20130730] missing" and

"org.elasticsearch.index.IndexShardMissingException: [20130727][6] missing"  
................................................................................................................................................................

Now i want to handle this  
"org.elasticsearch.transport.ConnectTransportException" Exception in my  
java Application.  
so i did the following..  
//in java application this Exception is triggered by this Client[when node  
is got down]object for every 5 seconds, so i added try-catch block for this  
Client object.  
Client client = null;  
try{  
//here we are assigning the TransportClient object[of data  
nodes].  
client =  
getClient(EDRPropertyBean.getMapClients());  
}catch(org.elasticsearch.transport.ConnectTransportException  
cTE){  
log.error("Some Exception message");  
// here we have Exception Handle Logic  
}

But This Exception Handling is not working, still we are getting the same  
Exception instead of our Exception Handle Logic.

1. Please Tell me What I have to Do for Catch the  
"org.elasticsearch.transport.ConnectTransportException" Exception  
so that I will run my Exception Handle Logic to handle the  
Node-Down[means, node is down]. and also
2. Please tell me if any other settings require for these nodes to handle  
the both querying and bulk loading at a time.

Thanks and Regards  
G Md Rafi

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [July 6, 2017, 2:22am UTC](https://discuss.elastic.co/t/org-elasticsearch-transport-connecttransportexception-cant-able-to-caught-in-java-application/13100/2 "2017-07-06T02:22:30Z")

</div>


