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


(Anusha) #1

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/

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/21dfda1f-39b6-4706-b375-29a8977dab93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Jörg Prante) #2

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> 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/

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.
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?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
Please update your bookmarks! We have moved to 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEEB7MeU9GL0r0FfjOAecXA7VBOz3NYdZ%2BU17Fd2u4Vcg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(system) #3