Integration of Elastic search 5.1.1 with Jboss fuse container

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 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 '' 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;
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?

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:

Might help.

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

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.

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

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