Two bundles looking for same package, but different versions | Community
Skip to main content
Level 2
March 30, 2017
Solved

Two bundles looking for same package, but different versions

  • March 30, 2017
  • 12 replies
  • 4095 views

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.
Best answer by joerghoh

Hi,

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

Jörg

12 replies

April 4, 2017

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

joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
April 4, 2017

Hi,

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

Jörg