# TransportClient timeout / webserver configuration - JAVA Api

**URL:** https://discuss.elastic.co/t/transportclient-timeout-webserver-configuration-java-api/16266
**Category:** Elasticsearch
**Created:** [March 10, 2014, 1:43pm UTC](https://discuss.elastic.co/t/transportclient-timeout-webserver-configuration-java-api/16266 "2014-03-10T13:43:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![roblangenfeld](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roblangenfeld/32/1565_2.png) [@roblangenfeld](https://discuss.elastic.co/u/roblangenfeld)
#### Post date: [March 10, 2014, 1:43pm UTC](https://discuss.elastic.co/t/transportclient-timeout-webserver-configuration-java-api/16266/1 "2014-03-10T13:43:42Z")

</div>

Hello,

I'm developing a tomcat webserver application that uses ElasticSearch 1.0  
(Java API). There is a client facing desktop application that communicates  
with the server so all the code for ElasticSearch is on that one instance  
and it is used by all our clients. With that being said I am running into  
this issue: After initializing a new TransportClient object and performing  
some operation on it, there is a chance that i could sit idle for a very  
long time. When does sit idle for a long time it gets this error:

Mar 08, 2014 1:15:37 AM org.elasticsearch.client.transport

INFO: [Elven] failed to get node info for  
[#transport#-1][WIN7-113-00726][inet[/159.140.213.87:9300]],  
disconnecting...

org.elasticsearch.transport.RemoteTransportException:  
[Server\_Dev1][inet[/159.140.213.87:9300]][cluster/nodes/info]

Caused by: java.lang.NullPointerException

at org.elasticsearch.http.HttpInfo.writeTo(HttpInfo.java:82)

at  
org.elasticsearch.action.admin.cluster.node.info.NodeInfo.writeTo(NodeInfo.java:301)

at  
org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse.writeTo(NodesInfoResponse.java:63)

at  
org.elasticsearch.transport.netty.NettyTransportChannel.sendResponse(NettyTransportChannel.java:83)

at  
org.elasticsearch.action.support.nodes.TransportNodesOperationAction$TransportHandler$1.onResponse(TransportNodesOperationAction.java:244)

at  
org.elasticsearch.action.support.nodes.TransportNodesOperationAction$TransportHandler$1.onResponse(TransportNodesOperationAction.java:239)

at  
org.elasticsearch.action.support.nodes.TransportNodesOperationAction$AsyncAction.finishHim(TransportNodesOperationAction.java:225)

at  
org.elasticsearch.action.support.nodes.TransportNodesOperationAction$AsyncAction.onOperation(TransportNodesOperationAction.java:200)

at  
org.elasticsearch.action.support.nodes.TransportNodesOperationAction$AsyncAction.access$900(TransportNodesOperationAction.java:102)

at  
org.elasticsearch.action.support.nodes.TransportNodesOperationAction$AsyncAction$2.run(TransportNodesOperationAction.java:146)

at  
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at  
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:744)

Is there any way to prevent this from happening? I know the ideal situation  
would be that after every request the transport client is closed. But since  
it lives on a webserver with lots of search requests coming in, we would  
ideally like it to stay open because it takes 3-4 seconds for a transport  
client to initialize and we are going for speed here.

Also since we are having one central server to handle all search and index  
requests, can the TransportClient handle multiple simultaneous requests from  
different users at the same time? We just want to make sure that we are  
doing this correctly.

--  
View this message in context: [http://elasticsearch-users.115913.n3.nabble.com/TransportClient-timeout-webserver-configuration-JAVA-Api-tp4051428.html](http://elasticsearch-users.115913.n3.nabble.com/TransportClient-timeout-webserver-configuration-JAVA-Api-tp4051428.html)  
Sent from the ElasticSearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1394459022952-4051428.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1394459022952-4051428.post%40n3.nabble.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [March 12, 2014, 10:05am UTC](https://discuss.elastic.co/t/transportclient-timeout-webserver-configuration-java-api/16266/2 "2014-03-12T10:05:08Z")

</div>

Hey,

can you create a github issue about this? An NPE should not happen. Please  
provide as much information as possible about your setup (see  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)) like es version, operating system, your  
elasticsearch setup etc...  
Thanks a lot!

--Alex

On Mon, Mar 10, 2014 at 2:43 PM, roblangenfeld [roblangenfeld@gmail.com](mailto:roblangenfeld@gmail.com)wrote:

> Hello,
> 
> I'm developing a tomcat webserver application that uses Elasticsearch 1.0  
> (Java API). There is a client facing desktop application that communicates  
> with the server so all the code for Elasticsearch is on that one instance  
> and it is used by all our clients. With that being said I am running into  
> this issue: After initializing a new TransportClient object and performing  
> some operation on it, there is a chance that i could sit idle for a very  
> long time. When does sit idle for a long time it gets this error:
> 
> Mar 08, 2014 1:15:37 AM org.elasticsearch.client.transport
> 
> INFO: [Elven] failed to get node info for  
> [#transport#-1][WIN7-113-00726][inet[/159.140.213.87:9300]],  
> disconnecting...
> 
> org.elasticsearch.transport.RemoteTransportException:  
> [Server\_Dev1][inet[/159.140.213.87:9300]][cluster/nodes/info]
> 
> Caused by: java.lang.NullPointerException
> 
> at org.elasticsearch.http.HttpInfo.writeTo(HttpInfo.java:82)
> 
> at
> 
> org.elasticsearch.action.admin.cluster.node.info.NodeInfo.writeTo(NodeInfo.java:301)
> 
> at
> 
> org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse.writeTo(NodesInfoResponse.java:63)
> 
> at
> 
> org.elasticsearch.transport.netty.NettyTransportChannel.sendResponse(NettyTransportChannel.java:83)
> 
> at
> 
> org.elasticsearch.action.support.nodes.TransportNodesOperationAction$TransportHandler$1.onResponse(TransportNodesOperationAction.java:244)
> 
> at
> 
> org.elasticsearch.action.support.nodes.TransportNodesOperationAction$TransportHandler$1.onResponse(TransportNodesOperationAction.java:239)
> 
> at
> 
> org.elasticsearch.action.support.nodes.TransportNodesOperationAction$AsyncAction.finishHim(TransportNodesOperationAction.java:225)
> 
> at
> 
> org.elasticsearch.action.support.nodes.TransportNodesOperationAction$AsyncAction.onOperation(TransportNodesOperationAction.java:200)
> 
> at
> 
> org.elasticsearch.action.support.nodes.TransportNodesOperationAction$AsyncAction.access$900(TransportNodesOperationAction.java:102)
> 
> at
> 
> org.elasticsearch.action.support.nodes.TransportNodesOperationAction$AsyncAction$2.run(TransportNodesOperationAction.java:146)
> 
> at
> 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 
> at
> 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 
> at java.lang.Thread.run(Thread.java:744)
> 
> Is there any way to prevent this from happening? I know the ideal situation  
> would be that after every request the transport client is closed. But since  
> it lives on a webserver with lots of search requests coming in, we would  
> ideally like it to stay open because it takes 3-4 seconds for a transport  
> client to initialize and we are going for speed here.
> 
> Also since we are having one central server to handle all search and index  
> requests, can the TransportClient handle multiple simultaneous requests  
> from  
> different users at the same time? We just want to make sure that we are  
> doing this correctly.
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/TransportClient-timeout-webserver-configuration-JAVA-Api-tp4051428.html](http://elasticsearch-users.115913.n3.nabble.com/TransportClient-timeout-webserver-configuration-JAVA-Api-tp4051428.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/1394459022952-4051428.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1394459022952-4051428.post%40n3.nabble.com)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAGCwEM8c9c1m9LiFEFygWpADAQywyB7K3%2BHMSCT%3Dui4yUHppRg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM8c9c1m9LiFEFygWpADAQywyB7K3%2BHMSCT%3Dui4yUHppRg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![roblangenfeld](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/roblangenfeld/32/1565_2.png) [@roblangenfeld](https://discuss.elastic.co/u/roblangenfeld)
#### Post date: [March 12, 2014, 2:15pm UTC](https://discuss.elastic.co/t/transportclient-timeout-webserver-configuration-java-api/16266/3 "2014-03-12T14:15:42Z")

</div>

Hey Alex,

I created a github issue for this:

> <https://github.com/elastic/elasticsearch/issues/5401>
>
> Elastic Search version: 1.0.0
> Operating System: Windows 7 Enterprise
> Java Versio…n: 1.7.0\_45
> Server setup:
> \- Windows Server 2003
> \- Java 1.7.0\_45
> \- Running Elastic Search as a service
> \- 1 Node with 1 index and 5 shards with 1 replica 
> 
> Here is the original issue:
> https://groups.google.com/forum/#!msg/elasticsearch/QJx0nzVci1s/uqzE2YhKGJIJ
> 
> We are using a an instance of a Transport Client to connect to our Elastic Search server. Since the instance is going to be living on a webserver, we need it to stay open so it is ready for whenever a user needs to perform a search, or data needs to be indexed. The problem is that if no operation is performed within an hour or so of the last operation on the transport client, it throws this error. The other scenario is if no operation is performed within 10-15 minutes of the Transport Client's last operation, and another operation is performed, it will throw the same error. 
> 
> If this error is thrown, sometimes it recovers and continues the operation, but a majority of the time it does not do this at all. Here is the stack trace:
> 
> \`\`\`
> Mar 08, 2014 1:15:37 AM org.elasticsearch.client.transport
> INFO: \[Elven\] failed to get node info for \[#transport#-1\]\[WIN7-113-00726\]\[inet\[/159.140.213.87:9300\]\], disconnecting...
> org.elasticsearch.transport.RemoteTransportException: \[Server\_Dev1\]\[inet\[/159.140.213.87:9300\]\]\[cluster/nodes/info\]
> Caused by: java.lang.NullPointerException
> at org.elasticsearch.http.HttpInfo.writeTo(HttpInfo.java:82)
> at org.elasticsearch.action.admin.cluster.node.info.NodeInfo.writeTo(NodeInfo.java:301)
> at org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse.writeTo(NodesInfoResponse.java:63)
> at org.elasticsearch.transport.netty.NettyTransportChannel.sendResponse(NettyTransportChannel.java:83)
> at org.elasticsearch.action.support.nodes.TransportNodesOperationAction$TransportHandler$1.onResponse(TransportNodesOperationAction.java:244)
> at org.elasticsearch.action.support.nodes.TransportNodesOperationAction$TransportHandler$1.onResponse(TransportNodesOperationAction.java:239)
> at org.elasticsearch.action.support.nodes.TransportNodesOperationAction$AsyncAction.finishHim(TransportNodesOperationAction.java:225)
> at org.elasticsearch.action.support.nodes.TransportNodesOperationAction$AsyncAction.onOperation(TransportNodesOperationAction.java:200)
> at org.elasticsearch.action.support.nodes.TransportNodesOperationAction$AsyncAction.access$900(TransportNodesOperationAction.java:102)
> at org.elasticsearch.action.support.nodes.TransportNodesOperationAction$AsyncAction$2.run(TransportNodesOperationAction.java:146)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:744)
> \`\`\`

Robert

On Wednesday, March 12, 2014 5:05:08 AM UTC-5, Alexander Reelsen wrote:

> Hey,
> 
> can you create a github issue about this? An NPE should not happen. Please  
> provide as much information as possible about your setup (see  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)) like es version, operating system,  
> your elasticsearch setup etc...  
> Thanks a lot!
> 
> --Alex
> 
> On Mon, Mar 10, 2014 at 2:43 PM, roblangenfeld \<[roblan...@gmail.com](mailto:roblan...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Hello,
> > 
> > I'm developing a tomcat webserver application that uses Elasticsearch 1.0  
> > (Java API). There is a client facing desktop application that communicates  
> > with the server so all the code for Elasticsearch is on that one instance  
> > and it is used by all our clients. With that being said I am running into  
> > this issue: After initializing a new TransportClient object and performing  
> > some operation on it, there is a chance that i could sit idle for a very  
> > long time. When does sit idle for a long time it gets this error:
> > 
> > Mar 08, 2014 1:15:37 AM org.elasticsearch.client.transport
> > 
> > INFO: [Elven] failed to get node info for  
> > [#transport#-1][WIN7-113-00726][inet[/159.140.213.87:9300]],  
> > disconnecting...
> > 
> > org.elasticsearch.transport.RemoteTransportException:  
> > [Server\_Dev1][inet[/159.140.213.87:9300]][cluster/nodes/info]
> > 
> > Caused by: java.lang.NullPointerException
> > 
> > at org.elasticsearch.http.HttpInfo.writeTo(HttpInfo.java:82)
> > 
> > at
> > 
> > org.elasticsearch.action.admin.cluster.node.info.NodeInfo.writeTo(NodeInfo.java:301)
> > 
> > at
> > 
> > org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse.writeTo(NodesInfoResponse.java:63)
> > 
> > at
> > 
> > org.elasticsearch.transport.netty.NettyTransportChannel.sendResponse(NettyTransportChannel.java:83)
> > 
> > at
> > 
> > org.elasticsearch.action.support.nodes.TransportNodesOperationAction$TransportHandler$1.onResponse(TransportNodesOperationAction.java:244)
> > 
> > at
> > 
> > org.elasticsearch.action.support.nodes.TransportNodesOperationAction$TransportHandler$1.onResponse(TransportNodesOperationAction.java:239)
> > 
> > at
> > 
> > org.elasticsearch.action.support.nodes.TransportNodesOperationAction$AsyncAction.finishHim(TransportNodesOperationAction.java:225)
> > 
> > at
> > 
> > org.elasticsearch.action.support.nodes.TransportNodesOperationAction$AsyncAction.onOperation(TransportNodesOperationAction.java:200)
> > 
> > at
> > 
> > org.elasticsearch.action.support.nodes.TransportNodesOperationAction$AsyncAction.access$900(TransportNodesOperationAction.java:102)
> > 
> > at
> > 
> > org.elasticsearch.action.support.nodes.TransportNodesOperationAction$AsyncAction$2.run(TransportNodesOperationAction.java:146)
> > 
> > at
> > 
> > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> > 
> > at
> > 
> > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> > 
> > at java.lang.Thread.run(Thread.java:744)
> > 
> > Is there any way to prevent this from happening? I know the ideal  
> > situation  
> > would be that after every request the transport client is closed. But  
> > since  
> > it lives on a webserver with lots of search requests coming in, we would  
> > ideally like it to stay open because it takes 3-4 seconds for a transport  
> > client to initialize and we are going for speed here.
> > 
> > Also since we are having one central server to handle all search and index  
> > requests, can the TransportClient handle multiple simultaneous requests  
> > from  
> > different users at the same time? We just want to make sure that we are  
> > doing this correctly.
> > 
> > --  
> > View this message in context:  
> > [http://elasticsearch-users.115913.n3.nabble.com/TransportClient-timeout-webserver-configuration-JAVA-Api-tp4051428.html](http://elasticsearch-users.115913.n3.nabble.com/TransportClient-timeout-webserver-configuration-JAVA-Api-tp4051428.html)  
> > Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> > 
> > --  
> > 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 [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/1394459022952-4051428.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1394459022952-4051428.post%40n3.nabble.com)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c37677c7-46b5-4f77-8a04-3a49da5fe414%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c37677c7-46b5-4f77-8a04-3a49da5fe414%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:43am UTC](https://discuss.elastic.co/t/transportclient-timeout-webserver-configuration-java-api/16266/4 "2017-07-06T01:43:47Z")

</div>


