I understand the concept of OSGi complaining about multiple dependency chains - a package is available more than once and when the importing bundle doesn't specify exactly which version it needs, so the OSGi container can run into the trouble of not knowing what to provide.
Unfortunately I ran into such a problem this week, but both involved bundles are third party bundles, so I can't really influence their imports and exports. Here are the two error messages I get:
org.osgi.framework.BundleException: Uses constraint violation. Unable to resolve bundle revision org.hibernate.core [28.0] because it is exposed to package 'javax.xml.stream' from bundle revisions com.springsource.javax.xml.stream [23.0] and org.apache.felix.framework [0] via two dependency chains.
Chain 1:
org.hibernate.core [28.0]
import: (osgi.wiring.package=javax.xml.stream)
|
export: osgi.wiring.package=javax.xml.stream
com.springsource.javax.xml.stream [23.0]
Chain 2:
org.hibernate.core [28.0]
import: (osgi.wiring.package=javax.xml.transform.stax)
|
export: osgi.wiring.package=javax.xml.transform.stax; uses:=javax.xml.stream
export: osgi.wiring.package=javax.xml.stream
org.apache.felix.framework [0]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3824)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1868)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
at java.lang.Thread.run(Thread.java:724)
org.osgi.framework.BundleException: Uses constraint violation. Unable to resolve bundle revision org.hibernate.core [28.0] because it is exposed to package 'javax.xml.stream' from bundle revisions org.apache.felix.framework [0] and com.springsource.javax.xml.stream [23.0] via two dependency chains.
Chain 1:
org.hibernate.core [28.0]
import: (osgi.wiring.package=javax.xml.stream)
|
export: osgi.wiring.package=javax.xml.stream
org.apache.felix.framework [0]
Chain 2:
org.hibernate.core [28.0]
import: (osgi.wiring.package=org.dom4j.io)
|
export: osgi.wiring.package=org.dom4j.io; uses:=javax.xml.stream
com.springsource.org.dom4j [27.0]
import: (&(osgi.wiring.package=javax.xml.stream)(version>=1.0.1)(!(version>=2.0.0)))
|
export: osgi.wiring.package=javax.xml.stream
com.springsource.javax.xml.stream [23.0]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3824)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1868)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
at java.lang.Thread.run(Thread.java:724)
When I try and remove com.springsource.javax.xml.stream
from installed bundles, com.springsource.org.dom4j
complains about missing package javax.xml.stream
.
I checked the MANIFEST.MF
file of org.apache.felix.framework
because I was really astonished of Felix apparently exporting javax.xml.stream
, but it contains no such entry. Also the dom4j
bundle does not reexport the streaming package according to it's manifest.
I'd be really grateful for any tips that could get me closer to answer the question where this dependency chain problem comes from. From my point of view I couldn't find a bundle besides com.springsource.javax.xml.stream
exporting said package-