Skip to main content
Level 2
Mar 30, 2017 9:37 PM UTC
Solved

Two bundles looking for same package, but different versions

Hi,

I have this ERROR:

org.osgi.framework.BundleException: Uses constraint violation. Unable to resolve bundle revision com.sample.test-wcm-bundle [397.825] because it is exposed to package 'org.apache.commons.lang.math' from bundle revisions com.sample.test-wcm-dependencies-bundle [398.824] and com.day.commons.osgi.wrapper.commons-lang2 [45.0] via two dependency chains.

com.day.commons.osgi.wrapper.commons-lang2 has commons-lang version 2.5, 

My bundle com.sample.test-wcm-dependencies-bundle needs commons-lang version 2.6.

How to resolve this?

thanks

Srini 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
joerghoh
joerghohAccepted solution
Adobe Employee
Apr 4, 2017 8:40 PM UTC

Hi,

the sample works here on AEM 6.2, the april-project bundle ist active.

Jörg

12 replies

Apr 4, 2017 3:42 AM UTC

Hi Srini,

It is bit difficult to visualise the actual dependency and the error. But try packaging your code bundle and dependencies as one bundle instead of two.

The problem here could be that when a bundle with second level dependencies which vary in version is installed, only the bundle itself is tried for a rewiring. When you restart the instance, all the bundles in the system are taken into account and attempted for a dependency rewiring.

Even in your current setup, just hit "Refresh Packages" in the Felix Console and your issue should be resolved.

HTH,

Thomas

Translate
joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
Apr 4, 2017 8:40 PM UTC

Hi,

the sample works here on AEM 6.2, the april-project bundle ist active.

Jörg

Translate