# Wares Plugin: Deploying elasticsearch as a servlet

**URL:** <https://discuss.elastic.co/t/wares-plugin-deploying-elasticsearch-as-a-servlet/5434>\
**Category:** Elasticsearch\
**Created:** [September 22, 2011, 1:14pm UTC](https://discuss.elastic.co/t/wares-plugin-deploying-elasticsearch-as-a-servlet/5434 "2011-09-22T13:14:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 22, 2011, 1:14pm UTC](https://discuss.elastic.co/t/wares-plugin-deploying-elasticsearch-as-a-servlet/5434/1 "2011-09-22T13:14:58Z")

</div>

A while back, I added the wares plugin, which basically allows to deploy  
elasticsearch as a servlet. The plugin is here:  
[https://github.com/elasticsearch/elasticsearch/tree/master/plugins/transport/wares](https://github.com/elasticsearch/elasticsearch/tree/master/plugins/transport/wares),  
and the NodeServlet is here:  
[https://github.com/elasticsearch/elasticsearch/blob/master/plugins/transport/wares/src/main/java/org/elasticsearch/wares/NodeServlet.java](https://github.com/elasticsearch/elasticsearch/blob/master/plugins/transport/wares/src/main/java/org/elasticsearch/wares/NodeServlet.java)  
.

Why its not officially out yet? Basically, its missing a few things:

1. The plugin should also have a sample web.xml configuration.
2. The plugin, when installed, should have a package script (sh and bat)  
that will create a sample war file out of the wares jar, the elasticsearch  
lib jars and the sample web.xml config.

So, someone up to the task of the above two points? (mainly aimed at JVM  
developers 🙂 ).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 22, 2011, 6:47pm UTC](https://discuss.elastic.co/t/wares-plugin-deploying-elasticsearch-as-a-servlet/5434/2 "2011-09-22T18:47:52Z")

</div>

If I understood, you want to create a simple webapp with ES embedded.

So, if It's what you ask for, why is it a plugin ?  
I would suggest to create a maven ES webapp archetype that will create a full new project that every user can modify and build and deploy.

What do you think ?

Did I misunderstood the use case ?

David

Le 22 sept. 2011 à 15:14, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) a écrit :

> A while back, I added the wares plugin, which basically allows to deploy elasticsearch as a servlet. The plugin is here: [https://github.com/elasticsearch/elasticsearch/tree/master/plugins/transport/wares](https://github.com/elasticsearch/elasticsearch/tree/master/plugins/transport/wares), and the NodeServlet is here: [https://github.com/elasticsearch/elasticsearch/blob/master/plugins/transport/wares/src/main/java/org/elasticsearch/wares/NodeServlet.java](https://github.com/elasticsearch/elasticsearch/blob/master/plugins/transport/wares/src/main/java/org/elasticsearch/wares/NodeServlet.java).
> 
> Why its not officially out yet? Basically, its missing a few things:
> 
> 1. The plugin should also have a sample web.xml configuration.
> 2. The plugin, when installed, should have a package script (sh and bat) that will create a sample war file out of the wares jar, the elasticsearch lib jars and the sample web.xml config.
> 
> So, someone up to the task of the above two points? (mainly aimed at JVM developers 🙂 ).

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [September 23, 2011, 2:06pm UTC](https://discuss.elastic.co/t/wares-plugin-deploying-elasticsearch-as-a-servlet/5434/3 "2011-09-23T14:06:07Z")

</div>

Two reasons why its a plugin:

1. Its simple to have it as a transport plugin since it gets published to  
maven automatically.
2. The idea of installing the plugin, and then, using the provided scripts I  
purposed in my first mail, build an "only" elasticsearch war module.

On Thu, Sep 22, 2011 at 9:47 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> If I understood, you want to create a simple webapp with ES embedded.
> 
> So, if It's what you ask for, why is it a plugin ?  
> I would suggest to create a maven ES webapp archetype that will create a  
> full new project that every user can modify and build and deploy.
> 
> What do you think ?
> 
> Did I misunderstood the use case ?
> 
> David
> 
> Le 22 sept. 2011 à 15:14, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) a écrit :
> 
> A while back, I added the wares plugin, which basically allows to deploy  
> elasticsearch as a servlet. The plugin is here: [https://github.com/elasticsearch/elasticsearch/tree/master/plugins/transport/wares](https://github.com/elasticsearch/elasticsearch/tree/master/plugins/transport/wares)  
> [https://github.com/elasticsearch/elasticsearch/tree/master/plugins/transport/wares](https://github.com/elasticsearch/elasticsearch/tree/master/plugins/transport/wares),  
> and the NodeServlet is here: [https://github.com/elasticsearch/elasticsearch/blob/master/plugins/transport/wares/src/main/java/org/elasticsearch/wares/NodeServlet.java](https://github.com/elasticsearch/elasticsearch/blob/master/plugins/transport/wares/src/main/java/org/elasticsearch/wares/NodeServlet.java)  
> [https://github.com/elasticsearch/elasticsearch/blob/master/plugins/transport/wares/src/main/java/org/elasticsearch/wares/NodeServlet.java](https://github.com/elasticsearch/elasticsearch/blob/master/plugins/transport/wares/src/main/java/org/elasticsearch/wares/NodeServlet.java)  
> .
> 
> Why its not officially out yet? Basically, its missing a few things:
> 
> 1. The plugin should also have a sample web.xml configuration.
> 2. The plugin, when installed, should have a package script (sh and bat)  
> that will create a sample war file out of the wares jar, the elasticsearch  
> lib jars and the sample web.xml config.
> 
> So, someone up to the task of the above two points? (mainly aimed at JVM  
> developers 🙂 ).

---

<div class="post-metadata">

**Author:** ![Kun\_Niu](https://avatars.discourse-cdn.com/v4/letter/k/8c91f0/32.png) [@Kun\_Niu](https://discuss.elastic.co/u/Kun_Niu)\
**Post date:** [September 30, 2011, 6:33am UTC](https://discuss.elastic.co/t/wares-plugin-deploying-elasticsearch-as-a-servlet/5434/4 "2011-09-30T06:33:54Z")

</div>

Hi Shay,  
After reading the code of the Servlet, I found that you only had one  
internal node instantiated.  
Would you mind giving me some hint on how to search based on the  
servlet?  
I found that it only supported GET method.  
If I use PUT, POST, I shall get an error.  
I get the latest code from github the day before yesterday.  
If you don't mind, I can try to write a script to create war.

Thanks and best regards

On 9月23日, 下午10时06分, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> Two reasons why its a plugin:
> 
> 1. Its simple to have it as a transport plugin since it gets published to  
> maven automatically.
> 2. The idea of installing the plugin, and then, using the provided scripts I  
> purposed in my first mail, build an "only" elasticsearch war module.
> 
> On Thu, Sep 22, 2011 at 9:47 PM, David Pilato [da...@pilato.fr](mailto:da...@pilato.fr) wrote:
> 
> > If I understood, you want to create a simple webapp with ES embedded.
> 
> > So, if It's what you ask for, why is it a plugin ?  
> > I would suggest to create a maven ES webapp archetype that will create a  
> > full new project that every user can modify and build and deploy.
> 
> > What do you think ?
> 
> > Did I misunderstood the use case ?
> 
> > David
> 
> > Le 22 sept. 2011 à 15:14, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) a écrit :
> 
> > A while back, I added the wares plugin, which basically allows to deploy  
> > elasticsearch as a servlet. The plugin is here: [https://github.com/elasticsearch/elasticsearch/tree/master/plugins/tr...](https://github.com/elasticsearch/elasticsearch/tree/master/plugins/tr...)  
> > [https://github.com/elasticsearch/elasticsearch/tree/master/plugins/tr](https://github.com/elasticsearch/elasticsearch/tree/master/plugins/tr)...,  
> > and the NodeServlet is here: [https://github.com/elasticsearch/elasticsearch/blob/master/plugins/tr...](https://github.com/elasticsearch/elasticsearch/blob/master/plugins/tr...)  
> > [https://github.com/elasticsearch/elasticsearch/blob/master/plugins/tr](https://github.com/elasticsearch/elasticsearch/blob/master/plugins/tr)...  
> > .
> 
> > Why its not officially out yet? Basically, its missing a few things:
> 
> > 1. The plugin should also have a sample web.xml configuration.
> > 2. The plugin, when installed, should have a package script (sh and bat)  
> > that will create a sample war file out of the wares jar, the elasticsearch  
> > lib jars and the sample web.xml config.
> 
> > So, someone up to the task of the above two points? (mainly aimed at JVM  
> > developers 🙂 ).- 隐藏被引用文字 -
> 
> - 显示引用的文字 -

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [October 2, 2011, 8:58am UTC](https://discuss.elastic.co/t/wares-plugin-deploying-elasticsearch-as-a-servlet/5434/5 "2011-10-02T08:58:48Z")

</div>

Why would there be a need for more than one Node (per JVM)? Not sure about  
the failures you get with PUT/POST, as you did not post them (and please,  
gist them).

2011/9/30 kun niu [haoniukun@gmail.com](mailto:haoniukun@gmail.com)

> Hi Shay,  
> After reading the code of the Servlet, I found that you only had one  
> internal node instantiated.  
> Would you mind giving me some hint on how to search based on the  
> servlet?  
> I found that it only supported GET method.  
> If I use PUT, POST, I shall get an error.  
> I get the latest code from github the day before yesterday.  
> If you don't mind, I can try to write a script to create war.
> 
> Thanks and best regards
> 
> On 9月23日, 下午10时06分, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:
> 
> > Two reasons why its a plugin:
> > 
> > 1. Its simple to have it as a transport plugin since it gets published to  
> > maven automatically.
> > 2. The idea of installing the plugin, and then, using the provided  
> > scripts I  
> > purposed in my first mail, build an "only" elasticsearch war module.
> > 
> > On Thu, Sep 22, 2011 at 9:47 PM, David Pilato [da...@pilato.fr](mailto:da...@pilato.fr) wrote:
> > 
> > > If I understood, you want to create a simple webapp with ES embedded.
> > 
> > > So, if It's what you ask for, why is it a plugin ?  
> > > I would suggest to create a maven ES webapp archetype that will create  
> > > a  
> > > full new project that every user can modify and build and deploy.
> > 
> > > What do you think ?
> > 
> > > Did I misunderstood the use case ?
> > 
> > > David
> > 
> > > Le 22 sept. 2011 à 15:14, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) a écrit :
> > 
> > > A while back, I added the wares plugin, which basically allows to  
> > > deploy  
> > > elasticsearch as a servlet. The plugin is here: \<  
> > > [https://github.com/elasticsearch/elasticsearch/tree/master/plugins/tr](https://github.com/elasticsearch/elasticsearch/tree/master/plugins/tr)...\>  
> > > [https://github.com/elasticsearch/elasticsearch/tree/master/plugins/tr](https://github.com/elasticsearch/elasticsearch/tree/master/plugins/tr)..  
> > > .,  
> > > and the NodeServlet is here: \<  
> > > [https://github.com/elasticsearch/elasticsearch/blob/master/plugins/tr](https://github.com/elasticsearch/elasticsearch/blob/master/plugins/tr)...\>  
> > > [https://github.com/elasticsearch/elasticsearch/blob/master/plugins/tr](https://github.com/elasticsearch/elasticsearch/blob/master/plugins/tr).  
> > > ..  
> > > .
> > 
> > > Why its not officially out yet? Basically, its missing a few things:
> > 
> > > 1. The plugin should also have a sample web.xml configuration.
> > > 2. The plugin, when installed, should have a package script (sh and  
> > > bat)  
> > > that will create a sample war file out of the wares jar, the  
> > > elasticsearch  
> > > lib jars and the sample web.xml config.
> > 
> > > So, someone up to the task of the above two points? (mainly aimed at  
> > > JVM  
> > > developers 🙂 ).- 隐藏被引用文字 -
> > 
> > - 显示引用的文字 -

---

<div class="post-metadata">

**Author:** ![Kun\_Niu](https://avatars.discourse-cdn.com/v4/letter/k/8c91f0/32.png) [@Kun\_Niu](https://discuss.elastic.co/u/Kun_Niu)\
**Post date:** [October 2, 2011, 9:27am UTC](https://discuss.elastic.co/t/wares-plugin-deploying-elasticsearch-as-a-servlet/5434/6 "2011-10-02T09:27:30Z")

</div>

Thank you for your attention to my problem.

It has been resolved.

I misconfigured my web.xml file.

Thanks and best regards,

Kun Niu

MSIT-SM program

Information Networking Institute

Carnegie Mellon University

4348 Hyland Ave. Apt 7

San Jose, CA 95127

Phone:1(412)608-8815

From: [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com) [[mailto:elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)]  
On Behalf Of Shay Banon  
Sent: 2011年10月2日 16:59  
To: [elasticsearch@googlegroups.com](mailto:elasticsearch@googlegroups.com)  
Subject: Re: Wares Plugin: Deploying elasticsearch as a servlet

Why would there be a need for more than one Node (per JVM)? Not sure about  
the failures you get with PUT/POST, as you did not post them (and please,  
gist them).

2011/9/30 kun niu [haoniukun@gmail.com](mailto:haoniukun@gmail.com)

Hi Shay,  
After reading the code of the Servlet, I found that you only had one  
internal node instantiated.  
Would you mind giving me some hint on how to search based on the  
servlet?  
I found that it only supported GET method.  
If I use PUT, POST, I shall get an error.  
I get the latest code from github the day before yesterday.  
If you don't mind, I can try to write a script to create war.

Thanks and best regards

On 9月23日, 下午10时06分, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> Two reasons why its a plugin:
> 
> 1. Its simple to have it as a transport plugin since it gets published to  
> maven automatically.
> 2. The idea of installing the plugin, and then, using the provided scripts  
> I  
> purposed in my first mail, build an "only" elasticsearch war module.

> On Thu, Sep 22, 2011 at 9:47 PM, David Pilato [da...@pilato.fr](mailto:da...@pilato.fr) wrote:
> 
> > If I understood, you want to create a simple webapp with ES embedded.
> 
> > So, if It's what you ask for, why is it a plugin ?  
> > I would suggest to create a maven ES webapp archetype that will create a  
> > full new project that every user can modify and build and deploy.
> 
> > What do you think ?
> 
> > Did I misunderstood the use case ?
> 
> > David

> > Le 22 sept. 2011 à 15:14, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) a écrit :

> > A while back, I added the wares plugin, which basically allows to deploy

> > elasticsearch as a servlet. The plugin is here:  
> > [https://github.com/elasticsearch/elasticsearch/tree/master/plugins/tr...](https://github.com/elasticsearch/elasticsearch/tree/master/plugins/tr...)  
> > [https://github.com/elasticsearch/elasticsearch/tree/master/plugins/tr](https://github.com/elasticsearch/elasticsearch/tree/master/plugins/tr)...,  
> > and the NodeServlet is here:  
> > [https://github.com/elasticsearch/elasticsearch/blob/master/plugins/tr...](https://github.com/elasticsearch/elasticsearch/blob/master/plugins/tr...)  
> > [https://github.com/elasticsearch/elasticsearch/blob/master/plugins/tr](https://github.com/elasticsearch/elasticsearch/blob/master/plugins/tr)...

> > .
> 
> > Why its not officially out yet? Basically, its missing a few things:
> 
> > 1. The plugin should also have a sample web.xml configuration.
> > 2. The plugin, when installed, should have a package script (sh and bat)  
> > that will create a sample war file out of the wares jar, the  
> > elasticsearch  
> > lib jars and the sample web.xml config.
> 
> > So, someone up to the task of the above two points? (mainly aimed at JVM

> > developers 🙂 ).- 隐藏被引用文字 -
> 
> - 显示引用的文字 -

---

<div class="post-metadata">

**Author:** ![guanyum](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guanyum/32/2658_2.png) [@guanyum](https://discuss.elastic.co/u/guanyum)\
**Post date:** [April 19, 2012, 3:15am UTC](https://discuss.elastic.co/t/wares-plugin-deploying-elasticsearch-as-a-servlet/5434/7 "2012-04-19T03:15:30Z")

</div>

it seems that the urls were out of date. for those who are crazy about es and want it deployed as a web-app like me, here is the real addresses i just found.

> **[elastic/elasticsearch-transport-wares](https://github.com/elastic/elasticsearch-transport-wares)**
>
> elasticsearch-transport-wares - Servlet transport for Elasticsearch

  

> <https://github.com/elastic/elasticsearch-transport-wares/blob/master/src/main/java/org/elasticsearch/wares/NodeServlet.java>

cheers~

---

<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:32am UTC](https://discuss.elastic.co/t/wares-plugin-deploying-elasticsearch-as-a-servlet/5434/8 "2017-07-06T03:32:04Z")

</div>


