# Java client usage when having 2 web apps

**URL:** <https://discuss.elastic.co/t/java-client-usage-when-having-2-web-apps/5365>\
**Category:** Elasticsearch\
**Created:** [September 13, 2011, 2:17am UTC](https://discuss.elastic.co/t/java-client-usage-when-having-2-web-apps/5365 "2011-09-13T02:17:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Carl\_Samson](https://avatars.discourse-cdn.com/v4/letter/c/b5a626/32.png) [@Carl\_Samson](https://discuss.elastic.co/u/Carl_Samson)\
**Post date:** [September 13, 2011, 2:17am UTC](https://discuss.elastic.co/t/java-client-usage-when-having-2-web-apps/5365/1 "2011-09-13T02:17:42Z")

</div>

Hi,

I have 2 web applications deployed on the same jvm. One is the admin that  
creates indexes and the other one is the public site for searching. When  
using the java API and this syntax. I would like to have ES woking as an  
embeded server without having to use TransportClient

Node node = nodeBuilder().local(true).node();  
Client client = node.client();

The first web app that will invoke the client will get a an instance of the  
client. As soon as i invoke the client from the second web application, ES  
starts in an infinite loop. I dont have any logs for now but is it something  
you already experienced ?

---

<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, 3:54am UTC](https://discuss.elastic.co/t/java-client-usage-when-having-2-web-apps/5365/2 "2017-07-06T03:54:37Z")

</div>


