# TransportClient createInjector error

**URL:** <https://discuss.elastic.co/t/transportclient-createinjector-error/28571>\
**Category:** Elasticsearch\
**Created:** [September 3, 2015, 1:57am UTC](https://discuss.elastic.co/t/transportclient-createinjector-error/28571 "2015-09-03T01:57:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![guiltyxsin](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@guiltyxsin](https://discuss.elastic.co/u/guiltyxsin)\
**Post date:** [September 3, 2015, 1:57am UTC](https://discuss.elastic.co/t/transportclient-createinjector-error/28571/1 "2015-09-03T01:57:39Z")

</div>

Hi All,

I am new to Elasticsearch and I am currently having this error when using ES2.

The error happens when Injector is being created during Node creation via NodeBuilder. The error is:  
Method threw 'java.lang.StackOverflowError' exception. Cannot evaluate org.elasticsearch.common.inject.InjectorImpl.toString()

I am not sure what I am doing wrong with the settings.  
Settings settings = NodeBuilder.nodeBuilder().settings()  
.put("script.groovy.sandbox.enabled", true)  
.put("script.inline", "on")  
.put("script.indexed", "on")  
.put("transport.tcp.port", 53568).build();  
Node node = NodeBuilder.nodeBuilder().client(false).data(true).clusterName("test").settings(settings).build();

Please provide guidance on what I should be looking at in order to find the root cause.

Thank you very much.

Regards,  
Andy

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [September 3, 2015, 2:39am UTC](https://discuss.elastic.co/t/transportclient-createinjector-error/28571/2 "2015-09-03T02:39:32Z")

</div>

Not sure what you mean by ES2. 2.0.0-beta1? Can you provide the entire stack? I cannot reproduce the issue with 2.0.0-beta1. Could you give a bit more information about your project setup?

By the way, your example is missing `path.home` setting and you don't start the node after you build it.

---

<div class="post-metadata">

**Author:** ![guiltyxsin](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@guiltyxsin](https://discuss.elastic.co/u/guiltyxsin)\
**Post date:** [September 3, 2015, 5:01am UTC](https://discuss.elastic.co/t/transportclient-createinjector-error/28571/3 "2015-09-03T05:01:01Z")

</div>

Thanks for your response. Sorry about not providing enough information.

I am helping out with the elastic-gremlin project to upgrade it to use elastisearch 2.0.0-beta1 from 1.5.2.

The path.home was set inside the vm option for the junit test suite and I can see a new folder created for the cluster.

The actual stack trace are not related to elasticsearch at all. What happens is that while creating index in elastic-gremlin, it checks cluster health and see if the timeout is true then throw an IOException. The status is red and timeout is true.

The stack overflow error for the injector was found while debugging through the code around creating transport client. The client is still created but the injector is having this error with it. As I am new to elasticsearch so I'm not sure if this is the root cause to tests failing.

I did email the developer of elastic-gremlin for guidance and am waiting for a response. But just want to see if someone have seen this issue before and can spot the root cause.

Not sure how much it would help with the stack from elastic-gremlin:

```
    java.lang.RuntimeException: GraphFactory could not instantiate this Graph implementation [org.elasticgremlin.structure.ElasticGraph]
	at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:74)
	at org.apache.tinkerpop.gremlin.GraphProvider.openTestGraph(GraphProvider.java:121)
	at org.apache.tinkerpop.gremlin.AbstractGremlinTest.setup(AbstractGremlinTest.java:83)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
        ...
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.apache.tinkerpop.gremlin.AbstractGremlinSuite.runChild(AbstractGremlinSuite.java:190)
	at org.apache.tinkerpop.gremlin.AbstractGremlinSuite.runChild(AbstractGremlinSuite.java:48)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.apache.tinkerpop.gremlin.structure.util.GraphFactory.open(GraphFactory.java:70)
	... 48 more
Caused by: java.lang.InstantiationException
	at org.elasticgremlin.structure.ElasticGraph.<init>(ElasticGraph.java:73)
	at org.elasticgremlin.structure.ElasticGraph.open(ElasticGraph.java:57)
	... 53 more
	Suppressed: java.io.IOException: RED status returned from cluster 'org.elasticsearch.client.support.AbstractClient$ClusterAdmin@6c538eb2', index 'standard'
		at org.elasticgremlin.queryhandler.elasticsearch.helpers.ElasticHelper.createIndex(ElasticHelper.java:54)
		at org.elasticgremlin.queryhandler.SimpleQueryHandler.init(SimpleQueryHandler.java:30)
		at org.elasticgremlin.structure.ElasticGraph.<init>(ElasticGraph.java:71)
		... 54 more
```

---

<div class="post-metadata">

**Author:** ![guiltyxsin](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@guiltyxsin](https://discuss.elastic.co/u/guiltyxsin)\
**Post date:** [September 3, 2015, 6:55am UTC](https://discuss.elastic.co/t/transportclient-createinjector-error/28571/4 "2015-09-03T06:55:02Z")

</div>

Ok, now when I delete the node folder the tests created I got a different stack trace.

```
NotSerializableExceptionWrapper[com/ning/compress/lzf/util/ChunkDecoderFactory]; nested: NotSerializableExceptionWrapper[com.ning.compress.lzf.util.ChunkDecoderFactory];
	at org.elasticsearch.common.compress.lzf.LZFCompressor.<init>(LZFCompressor.java:48)
	at org.elasticsearch.common.compress.CompressorFactory.<clinit>(CompressorFactory.java:44)
	at org.elasticsearch.common.compress.CompressedXContent.<init>(CompressedXContent.java:83)
	at org.elasticsearch.index.mapper.DocumentMapper.refreshSource(DocumentMapper.java:436)
	at org.elasticsearch.index.mapper.DocumentMapper.<init>(DocumentMapper.java:228)
	at org.elasticsearch.index.mapper.DocumentMapper$Builder.build(DocumentMapper.java:153)
	at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:250)
	at org.elasticsearch.index.mapper.DocumentMapperParser.parseCompressed(DocumentMapperParser.java:189)
	at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:371)
	at org.elasticsearch.index.mapper.MapperService.documentMapperWithAutoCreate(MapperService.java:398)
	at org.elasticsearch.index.shard.IndexShard.docMapper(IndexShard.java:1352)
	at org.elasticsearch.index.shard.IndexShard.prepareCreate(IndexShard.java:460)
        ....
Caused by: NotSerializableExceptionWrapper[com.ning.compress.lzf.util.ChunkDecoderFactory]
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 21 more

java.lang.NoClassDefFoundError: Could not initialize class org.elasticsearch.common.xcontent.smile.SmileXContent
	at org.elasticsearch.common.xcontent.XContentFactory.contentBuilder(XContentFactory.java:124)
	at org.elasticsearch.action.support.ToXContentToBytes.buildAsBytes(ToXContentToBytes.java:62)
	at org.elasticsearch.action.deletebyquery.DeleteByQueryRequest.source(DeleteByQueryRequest.java:148)
	at org.elasticsearch.action.deletebyquery.DeleteByQueryRequestBuilder.execute(DeleteByQueryRequestBuilder.java:170)
	at org.elasticgremlin.queryhandler.elasticsearch.helpers.ElasticHelper.clearIndex(ElasticHelper.java:70)
	at org.elasticgremlin.ElasticGraphGraphProvider.clear(ElasticGraphGraphProvider.java:95)
	at org.apache.tinkerpop.gremlin.AbstractGremlinTest.tearDown(AbstractGremlinTest.java:132)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
         ...
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)

NotSerializableExceptionWrapper[Could not initialize class org.elasticsearch.common.compress.CompressorFactory]
	at org.elasticsearch.common.compress.CompressedXContent.<init>(CompressedXContent.java:83)
	at org.elasticsearch.index.mapper.DocumentMapper.refreshSource(DocumentMapper.java:436)
	at org.elasticsearch.index.mapper.DocumentMapper.<init>(DocumentMapper.java:228)
	at org.elasticsearch.index.mapper.DocumentMapper$Builder.build(DocumentMapper.java:153)
	at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:250)
	at org.elasticsearch.index.mapper.DocumentMapperParser.parseCompressed(DocumentMapperParser.java:189)
	at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:371)

```

Any ideas? I am not sure where to start the investigation.

---

<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:** [September 3, 2015, 9:20am UTC](https://discuss.elastic.co/t/transportclient-createinjector-error/28571/5 "2015-09-03T09:20:56Z")

</div>

> [@guiltyxsin](#):
>
> com.ning.compress.lzf.util.ChunkDecoderFactory

Can you try to add the dependency com.ning:compress-lzf to your classpath?

Example

```auto
<dependency>
	<groupId>com.ning</groupId>
	<artifactId>compress-lzf</artifactId>
	<version>1.0.3</version>
</dependency>

```

---

<div class="post-metadata">

**Author:** ![guiltyxsin](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@guiltyxsin](https://discuss.elastic.co/u/guiltyxsin)\
**Post date:** [September 4, 2015, 2:33am UTC](https://discuss.elastic.co/t/transportclient-createinjector-error/28571/6 "2015-09-04T02:33:45Z")

</div>

Hi Jorg,

Thanks for the response. It is indeed dependency issue but not related to the compressor.

However, your reply point me to the right direction. After I resolve the dependency things just worked.

Thanks a lot.

Regards,  
Andy

---

<div class="post-metadata">

**Author:** ![piteron](https://avatars.discourse-cdn.com/v4/letter/p/8e7dd6/32.png) [@piteron](https://discuss.elastic.co/u/piteron)\
**Post date:** [December 17, 2015, 11:45am UTC](https://discuss.elastic.co/t/transportclient-createinjector-error/28571/7 "2015-12-17T11:45:54Z")

</div>

Hi guys,

Andy, could you tell me what was the dependency issue you faced? I have the same exact problem with java.lang.StackOverflowError exception.

---

<div class="post-metadata">

**Author:** ![rikard](https://avatars.discourse-cdn.com/v4/letter/r/82dd89/32.png) [@rikard](https://discuss.elastic.co/u/rikard)\
**Post date:** [December 18, 2015, 7:09pm UTC](https://discuss.elastic.co/t/transportclient-createinjector-error/28571/9 "2015-12-18T19:09:34Z")

</div>

If anyone is looking for a solution to this, the dependency problem, at least for me, was an old version of jackson. I had this issue and updated jackson from 2.5.1 to 2.6.4 and the problem went away.

---

<div class="post-metadata">

**Author:** ![guiltyxsin](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@guiltyxsin](https://discuss.elastic.co/u/guiltyxsin)\
**Post date:** [December 19, 2015, 5:57am UTC](https://discuss.elastic.co/t/transportclient-createinjector-error/28571/10 "2015-12-19T05:57:32Z")

</div>

Hi Piotr,

It was sometime ago, I was trying to upgrade the code from elasticsearch 1.5 to 2.0 back then. What I did was I upgraded the jars and fixed the compile errors and everything can compile but I only identified the dependency issue when I try to build it. It was some dependency around jackson-dataformat-yaml and I need to exclude snakeyaml.

But that's specific to the elastic-gremlin project so I am not sure if that's related to your one.

---

<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 5, 2017, 11:29pm UTC](https://discuss.elastic.co/t/transportclient-createinjector-error/28571/11 "2017-07-05T23:29:48Z")

</div>


