Guice Creation Error


(esuser) #1

Hi,

We are using Spring Framework with elasticsearch.

ES Version : 1.2.1

Code

Client client = new TransportClient().addTransportAddress(new
InetSocketTransportAddress(url, 9300));

SearchResponse response = client.prepareSearch(""escore")
.addAggregation(AggregationBuilders.cardinality("CUSTOMER").field("CUSTOMER"))
.setSize(0).execute().actionGet();
client.close();

It works fine for fist few hits , After that it throws below
exception. Is there any thing wrong with the code. Really appreciate
any pointers/help on this.

java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: *Guice
creation errors:
*

  1. Error injecting constructor, java.lang.OutOfMemoryError: unable to
    create new native thread

    at org.elasticsearch.threadpool.ThreadPool.(Unknown Source)
    while locating org.elasticsearch.threadpool.ThreadPoolCaused by:
    java.lang.OutOfMemoryError: unable to create new native thread

    at java.lang.Thread.start0(Native Method)
    at java.lang.Thread.start(Thread.java:713)
    at org.elasticsearch.threadpool.ThreadPool.(ThreadPool.java:144)
    at sun.reflect.GeneratedConstructorAccessor69.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.elasticsearch.common.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:54)
    at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:86)
    at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:98)
    at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
    at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:837)
    at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
    at org.elasticsearch.common.inject.Scopes$1$1.get(Scopes.java:57)
    at org.elasticsearch.common.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
    at org.elasticsearch.common.inject.InjectorBuilder$1.call(InjectorBuilder.java:200)
    at org.elasticsearch.common.inject.InjectorBuilder$1.call(InjectorBuilder.java:193)
    at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:830)
    at org.elasticsearch.common.inject.InjectorBuilder.loadEagerSingletons(InjectorBuilder.java:193)
    at org.elasticsearch.common.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:175)
    at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:110)
    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:117)

--
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/CAJfX5E2rVXE7eVe08JTkgx8rpmOQPsFCjUdEgrxz8rZuurBEog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(David Pilato) #2

Do you create a new client for each request?
If so, create only one client when your application start.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 4 août 2014 à 00:42, Subacini B subacini@gmail.com a écrit :

Hi,

We are using Spring Framework with elasticsearch.

ES Version : 1.2.1
Code

Client client = new TransportClient().addTransportAddress(new InetSocketTransportAddress(url, 9300));

SearchResponse response = client.prepareSearch(""escore")
.addAggregation(AggregationBuilders.cardinality("CUSTOMER").field("CUSTOMER"))
.setSize(0).execute().actionGet();

	client.close();

It works fine for fist few hits , After that it throws below exception. Is there any thing wrong with the code. Really appreciate any pointers/help on this.

java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: Guice creation errors:

  1. Error injecting constructor, java.lang.OutOfMemoryError: unable to create new native thread
    at org.elasticsearch.threadpool.ThreadPool.(Unknown Source)
    while locating org.elasticsearch.threadpool.ThreadPool
    Caused by: java.lang.OutOfMemoryError: unable to create new native thread
    at java.lang.Thread.start0(Native Method)
    at java.lang.Thread.start(Thread.java:713)
    at org.elasticsearch.threadpool.ThreadPool.(ThreadPool.java:144)
    at sun.reflect.GeneratedConstructorAccessor69.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at org.elasticsearch.common.inject.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:54)
    at org.elasticsearch.common.inject.ConstructorInjector.construct(ConstructorInjector.java:86)
    at org.elasticsearch.common.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:98)
    at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:45)
    at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:837)
    at org.elasticsearch.common.inject.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:42)
    at org.elasticsearch.common.inject.Scopes$1$1.get(Scopes.java:57)
    at org.elasticsearch.common.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:45)
    at org.elasticsearch.common.inject.InjectorBuilder$1.call(InjectorBuilder.java:200)
    at org.elasticsearch.common.inject.InjectorBuilder$1.call(InjectorBuilder.java:193)
    at org.elasticsearch.common.inject.InjectorImpl.callInContext(InjectorImpl.java:830)
    at org.elasticsearch.common.inject.InjectorBuilder.loadEagerSingletons(InjectorBuilder.java:193)
    at org.elasticsearch.common.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:175)
    at org.elasticsearch.common.inject.InjectorBuilder.build(InjectorBuilder.java:110)
    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:117)
    --
    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/CAJfX5E2rVXE7eVe08JTkgx8rpmOQPsFCjUdEgrxz8rZuurBEog%40mail.gmail.com.
    For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/D2EB8DCB-6E3B-4324-981F-22273EE46808%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.


(system) #3