# Error using elasticsearch with OSGi

**URL:** <https://discuss.elastic.co/t/error-using-elasticsearch-with-osgi/18790>\
**Category:** Elasticsearch\
**Created:** [July 22, 2014, 12:15pm UTC](https://discuss.elastic.co/t/error-using-elasticsearch-with-osgi/18790 "2014-07-22T12:15:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vivek\_Sachdeva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vivek_sachdeva/32/1339_2.png) [@Vivek\_Sachdeva](https://discuss.elastic.co/u/Vivek_Sachdeva)\
**Post date:** [July 22, 2014, 12:15pm UTC](https://discuss.elastic.co/t/error-using-elasticsearch-with-osgi/18790/1 "2014-07-22T12:15:32Z")

</div>

I am using elastic search 1.0.1 and have following dependency in POM.

 org.apache.servicemix.bundles

org.apache.servicemix.bundles.elasticsearch  
1.0.0\_1

I am getting multiple errors some of them being:

org.elasticsearch.common.inject.CreationException: Guice creation errors:

1. Error injecting constructor, java.lang.NoClassDefFoundError:  
sun/misc/Unsafe  
at org.elasticsearch.threadpool.ThreadPool.(Unknown Source)  
while locating org.elasticsearch.threadpool.ThreadPool  
Caused by: java.lang.NoClassDefFoundError: sun/misc/Unsafe

2. Error injecting constructor, java.lang.NoClassDefFoundError: Could not  
initialize class org.elasticsearch.common.util.concurrent.jsr166e.LongAdder  
at org.elasticsearch.threadpool.ThreadPool.(Unknown Source)  
while locating org.elasticsearch.threadpool.ThreadPool  
for parameter 1 at  
org.elasticsearch.transport.netty.NettyTransport.(Unknown Source)  
while locating org.elasticsearch.transport.netty.NettyTransport  
while locating org.elasticsearch.transport.Transport  
for parameter 1 at  
org.elasticsearch.transport.TransportService.(Unknown Source)  
while locating org.elasticsearch.transport.TransportService  
Caused by: java.lang.NoClassDefFoundError: Could not initialize class  
org.elasticsearch.common.util.concurrent.jsr166e.LongAdder

Any idea!!!!

--  
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/0f279584-8e33-4194-8fad-d5db2dbea82e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0f279584-8e33-4194-8fad-d5db2dbea82e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Vivek\_Sachdeva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vivek_sachdeva/32/1339_2.png) [@Vivek\_Sachdeva](https://discuss.elastic.co/u/Vivek_Sachdeva)\
**Post date:** [July 22, 2014, 12:29pm UTC](https://discuss.elastic.co/t/error-using-elasticsearch-with-osgi/18790/2 "2014-07-22T12:29:40Z")

</div>

I am using:  
TransportClient transportClient = new TransportClient(settingsBuilder())

where

def settingsBuilder() {  
def transportSettings = ImmutableSettings.settingsBuilder().put("  
cluster.name", "elasticsearch");  
transportSettings.put("client.transport.ping\_timeout", "60000")  
transportSettings.put("client.transport.ignore\_cluster\_name", true)  
// Use the "sniff" feature of transport client ?  
transportSettings.put("client.transport.sniff", false)  
return transportSettings  
}

On Tue, Jul 22, 2014 at 5:45 PM, Vivek Sachdeva \<  
[vivek.sachdeva@intelligrape.com](mailto:vivek.sachdeva@intelligrape.com)\> wrote:

> I am using Elasticsearch 1.0.1 and have following dependency in POM.
> 
> org.apache.servicemix.bundles
> 
> org.apache.servicemix.bundles.elasticsearch  
> 1.0.0\_1
> 
> I am getting multiple errors some of them being:
> 
> org.elasticsearch.common.inject.CreationException: Guice creation errors:
> 
> 1. Error injecting constructor, java.lang.NoClassDefFoundError:  
> sun/misc/Unsafe  
> at org.elasticsearch.threadpool.ThreadPool.(Unknown Source)  
> while locating org.elasticsearch.threadpool.ThreadPool  
> Caused by: java.lang.NoClassDefFoundError: sun/misc/Unsafe
> 
> 2. Error injecting constructor, java.lang.NoClassDefFoundError: Could not  
> initialize class org.elasticsearch.common.util.concurrent.jsr166e.LongAdder  
> at org.elasticsearch.threadpool.ThreadPool.(Unknown Source)  
> while locating org.elasticsearch.threadpool.ThreadPool  
> for parameter 1 at  
> org.elasticsearch.transport.netty.NettyTransport.(Unknown Source)  
> while locating org.elasticsearch.transport.netty.NettyTransport  
> while locating org.elasticsearch.transport.Transport  
> for parameter 1 at  
> org.elasticsearch.transport.TransportService.(Unknown Source)  
> while locating org.elasticsearch.transport.TransportService  
> Caused by: java.lang.NoClassDefFoundError: Could not initialize class  
> org.elasticsearch.common.util.concurrent.jsr166e.LongAdder
> 
> Any idea!!!!
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/1vDijYLylwc/unsubscribe](https://groups.google.com/d/topic/elasticsearch/1vDijYLylwc/unsubscribe).  
> To unsubscribe from this group and all its topics, 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/0f279584-8e33-4194-8fad-d5db2dbea82e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0f279584-8e33-4194-8fad-d5db2dbea82e%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/0f279584-8e33-4194-8fad-d5db2dbea82e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0f279584-8e33-4194-8fad-d5db2dbea82e%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
Thanks & Regards.  
Vivek Sachdeva  
Intelligrape Software Pvt. Ltd.

--  
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/CABpbMD2KfXLHEVR9C01K-FxT9-KsA76bJ7ybKVdrK8JSwb%3DD7A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CABpbMD2KfXLHEVR9C01K-FxT9-KsA76bJ7ybKVdrK8JSwb%3DD7A%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, 1:14am UTC](https://discuss.elastic.co/t/error-using-elasticsearch-with-osgi/18790/3 "2017-07-06T01:14:15Z")

</div>


