# Integration of Elastic search 5.1.1 with Jboss fuse container

**URL:** <https://discuss.elastic.co/t/integration-of-elastic-search-5-1-1-with-jboss-fuse-container/71937>\
**Category:** Elasticsearch\
**Created:** [January 18, 2017, 4:33am UTC](https://discuss.elastic.co/t/integration-of-elastic-search-5-1-1-with-jboss-fuse-container/71937 "2017-01-18T04:33:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sstest](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sstest/32/43659_2.png) [@sstest](https://discuss.elastic.co/u/sstest)\
**Post date:** [January 18, 2017, 4:33am UTC](https://discuss.elastic.co/t/integration-of-elastic-search-5-1-1-with-jboss-fuse-container/71937/1 "2017-01-18T04:33:43Z")

</div>

Hi, I have written Transport client in camel to connect Elastic search 5.1.1 server, but when deploying in to Jboss fuse container, I am getting the below error.

This looks the package **org.apache.lucene.search** is available in both **lucene-misc-6.3.0.jar** and **lucene-core-6.3.0.jar** jar files which is not allowed in jboss fuse to deploy and resolve.

**_Error logs from Fuse container:-_**  
Caused by: org.osgi.framework.BundleException: **_Uses constraint violation_**. Unable to resolve bundle revision wrap\_file\_\_d\_workspace\_localrepo-v1\_org\_apache\_lucene\_lucene-misc\_6.3.0\_lucene-misc-6.3.0.jar [410.0] because it exports package 'org.apache.lucene.search' and is also exposed to it from bundle revision wrap\_file\_\_d\_workspace\_localrepo-v1\_org\_apache\_lucene\_lucene-core\_6.3.0\_lucene-core-6.3.0.jar [405.0] via the following dependency chain:

wrap\_file\_\_d\_workspace\_localrepo-v1\_org\_apache\_lucene\_lucene-misc\_6.3.0\_lucene-misc-6.3.0.jar [410.0]  
import: (osgi.wiring.package=org.apache.lucene.util.packed)  
|  
export: osgi.wiring.package=org.apache.lucene.util.packed; uses:=org.apache.lucene.search  
export: osgi.wiring.package=org.apache.lucene.search  
wrap\_file\_\_d\_workspace\_localrepo-v1\_org\_apache\_lucene\_lucene-core\_6.3.0\_lucene-core-6.3.0.jar [405.0]

_Can anybody help on this pls?_

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 18, 2017, 6:59am UTC](https://discuss.elastic.co/t/integration-of-elastic-search-5-1-1-with-jboss-fuse-container/71937/2 "2017-01-18T06:59:10Z")

</div>

That's a bit weird. I never heard that you can not have 2 different classes in the same package coming from 2 different JARS. IMO this is allowed.

On the opposite, having the same class name in two jars is forbidden. This is something we detect in elasticsearch with the JarHell checker BTW.

Here, I don't know what you can easily do apart raising this issue on Jboss project.

A bit more complex, you can create one single big JAR which contains all classes and if needed relocate some classes but I don't think this is needed.

Read some information at:

> **[To shade or not to shade](https://www.elastic.co/blog/to-shade-or-not-to-shade)**
>
> Before version 2.0, Elasticsearch was provided as a JAR with some (but not all) common dependencies shaded and packaged within the same artifact. This helped Java users who embed Elasticsearch in thei...

Might help.

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [January 18, 2017, 8:13am UTC](https://discuss.elastic.co/t/integration-of-elastic-search-5-1-1-with-jboss-fuse-container/71937/3 "2017-01-18T08:13:21Z")

</div>

> [@dadoonet](#):
>
> That's a bit weird. I never heard that you can not have 2 different classes in the same package coming from 2 different JARS. IMO this is allowed.

It's called the split package problem. It's discouraged, OSGi hates it, some other classloaders also do, and Jigsaw (JDK 9) will too.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 18, 2017, 9:20am UTC](https://discuss.elastic.co/t/integration-of-elastic-search-5-1-1-with-jboss-fuse-container/71937/4 "2017-01-18T09:20:27Z")

</div>

Interesting to know.  
So I think we should fix duplicated packages in our code base (I'm speaking about elasticsearch).

For example, some plugins are using the same package name in `discovery-ec2` and `repository-s3`. I know it's not really an issue when you run elasticsearch as they are loaded by different class loaders but we should fix it to conform with this split package policy then.

---

<div class="post-metadata">

**Author:** ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)\
**Post date:** [January 18, 2017, 9:34am UTC](https://discuss.elastic.co/t/integration-of-elastic-search-5-1-1-with-jboss-fuse-container/71937/5 "2017-01-18T09:34:51Z")

</div>

Yes, it's on the radar for something we will have to investigate for JDK 9.

---

<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:** [February 15, 2017, 9:34am UTC](https://discuss.elastic.co/t/integration-of-elastic-search-5-1-1-with-jboss-fuse-container/71937/6 "2017-02-15T09:34:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
