# Elasticsearch-knapsack plugin for update settings throwing exception in main with Client

**URL:** <https://discuss.elastic.co/t/elasticsearch-knapsack-plugin-for-update-settings-throwing-exception-in-main-with-client/23721>\
**Category:** Elasticsearch\
**Created:** [May 29, 2015, 9:07am UTC](https://discuss.elastic.co/t/elasticsearch-knapsack-plugin-for-update-settings-throwing-exception-in-main-with-client/23721 "2015-05-29T09:07:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anusha](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@Anusha](https://discuss.elastic.co/u/Anusha)\
**Post date:** [May 29, 2015, 9:07am UTC](https://discuss.elastic.co/t/elasticsearch-knapsack-plugin-for-update-settings-throwing-exception-in-main-with-client/23721/1 "2015-05-29T09:07:08Z")

</div>

Hi All,

Am using elasticsearch-knapsack plugin for update settings and for few  
other actions but am unable to start it , I just started using normal  
client creation as:

public class KnapSackImport {

```
private static Client client = null;

@Inject
public static Client getClient()
{
    Client client = new TransportClient()
    .addTransportAddress(new InetSocketTransportAddress("192.168.1.59", 

```

9300));  
if(client!=null)  
{  
System.out.println("client");  
}  
return client;  
}

```
public static void main(String args[])
{

    getClient();
    
}

```

}

So when am running this am getting :

Exception in thread "main"  
org.elasticsearch.common.inject.CreationException: Guice creation errors:

1. No implementation for org.elasticsearch.cluster.ClusterService was bound.  
while locating org.elasticsearch.cluster.ClusterService  
for parameter 1 at  
org.xbib.elasticsearch.knapsack.KnapsackService.(Unknown Source)  
at  
org.xbib.elasticsearch.knapsack.KnapsackModule.configure(KnapsackModule.java:25)

2. A binding to org.xbib.elasticsearch.knapsack.KnapsackService was already  
configured at  
org.xbib.elasticsearch.knapsack.KnapsackModule.configure(KnapsackModule.java:25).  
at  
org.xbib.elasticsearch.knapsack.KnapsackModule.configure(KnapsackModule.java:25)

2 errors  
at  
org.elasticsearch.common.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:344)  
at  
org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:151)  
at  
org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:102)  
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:93)  
at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70)  
at  
org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:59)  
at  
org.elasticsearch.client.transport.TransportClient.(TransportClient.java:187)  
at  
org.elasticsearch.client.transport.TransportClient.(TransportClient.java:115)  
at com.knapsack.KnapSackImport.getClient(KnapSackImport.java:21)  
at com.knapsack.KnapSackImport.main(KnapSackImport.java:33)

Can anyone trace this and tell me how to proceed with this ..

## -- Please update your bookmarks! We have moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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/21dfda1f-39b6-4706-b375-29a8977dab93%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/21dfda1f-39b6-4706-b375-29a8977dab93%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [May 29, 2015, 9:15am UTC](https://discuss.elastic.co/t/elasticsearch-knapsack-plugin-for-update-settings-throwing-exception-in-main-with-client/23721/2 "2015-05-29T09:15:45Z")

</div>

You can not run the Knapsack plugin at transport client side. It must run  
at server side in a node being part of the cluster.

Jörg

On Fri, May 29, 2015 at 11:07 AM, Muddadi Hemaanusha \<  
[hemaanusha.bunny@gmail.com](mailto:hemaanusha.bunny@gmail.com)\> wrote:

> Hi All,
> 
> Am using elasticsearch-knapsack plugin for update settings and for few  
> other actions but am unable to start it , I just started using normal  
> client creation as:
> 
> public class KnapSackImport {
> 
> ```
> private static Client client = null;
> 
> @Inject
> public static Client getClient()
> {
> Client client = new TransportClient()
> .addTransportAddress(new
> 
> ```
> 
> InetSocketTransportAddress("192.168.1.59", 9300));  
> if(client!=null)  
> {  
> System.out.println("client");  
> }  
> return client;  
> }
> 
> ```
> public static void main(String args[])
> {
> 
> getClient();
> 
> }
> 
> ```
> 
> }
> 
> So when am running this am getting :
> 
> Exception in thread "main"  
> org.elasticsearch.common.inject.CreationException: Guice creation errors:
> 
> 1. No implementation for org.elasticsearch.cluster.ClusterService was  
> bound.  
> while locating org.elasticsearch.cluster.ClusterService  
> for parameter 1 at  
> org.xbib.elasticsearch.knapsack.KnapsackService.(Unknown Source)  
> at  
> org.xbib.elasticsearch.knapsack.KnapsackModule.configure(KnapsackModule.java:25)
> 
> 2. A binding to org.xbib.elasticsearch.knapsack.KnapsackService was  
> already configured at  
> org.xbib.elasticsearch.knapsack.KnapsackModule.configure(KnapsackModule.java:25).  
> at  
> org.xbib.elasticsearch.knapsack.KnapsackModule.configure(KnapsackModule.java:25)
> 
> 2 errors  
> at  
> org.elasticsearch.common.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:344)  
> at  
> org.elasticsearch.common.inject.InjectorBuilder.initializeStatically(InjectorBuilder.java:151)  
> at  
> org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:102)  
> at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:93)  
> at org.elasticsearch.common.inject.Guice.createInjector(Guice.java:70)  
> at  
> org.elasticsearch.common.inject.ModulesBuilder.createInjector(ModulesBuilder.java:59)  
> at  
> org.elasticsearch.client.transport.TransportClient.(TransportClient.java:187)  
> at  
> org.elasticsearch.client.transport.TransportClient.(TransportClient.java:115)  
> at com.knapsack.KnapSackImport.getClient(KnapSackImport.java:21)  
> at com.knapsack.KnapSackImport.main(KnapSackImport.java:33)
> 
> Can anyone trace this and tell me how to proceed with this ..
> 
> ## -- Please update your bookmarks! We have moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)
> 
> 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/21dfda1f-39b6-4706-b375-29a8977dab93%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/21dfda1f-39b6-4706-b375-29a8977dab93%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/21dfda1f-39b6-4706-b375-29a8977dab93%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/21dfda1f-39b6-4706-b375-29a8977dab93%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## -- Please update your bookmarks! We have moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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/CAKdsXoEEB7MeU9GL0r0FfjOAecXA7VBOz3NYdZ%2BU17Fd2u4Vcg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEEB7MeU9GL0r0FfjOAecXA7VBOz3NYdZ%2BU17Fd2u4Vcg%40mail.gmail.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, 12:10am UTC](https://discuss.elastic.co/t/elasticsearch-knapsack-plugin-for-update-settings-throwing-exception-in-main-with-client/23721/3 "2017-07-06T00:10:52Z")

</div>


