Loading bundle in felix fails due to dependency on itself

201 views Asked by At

I'm clearly being moronic here but I can't see the problem:

I'm trying to load a bundle in Karaf 4 M3 and the error I get is this

org.osgi.framework.BundleException: Unable to resolve package-core [50](R 50.0): missing requirement [package-core [50](R 50.0)] osgi.wiring.package; (osgi.wiring.package=bi.package.internal) Unresolved requirements: [[package-core [50](R 50.0)] osgi.wiring.package; (osgi.wiring.package=bi.package.internal)]

My Manifest is generated by Maven and looks like this:

Manifest-Version: 1.0
Export-Package: bi.package.core.repository;uses:="bi.package.core.repository.objects";version="4.0.0.SNAPSHOT",bi.package.core.repository.objects;version="4.0.0.SNAPSHOT"
Private-Package: bi.package.internal.*
Built-By: bugg
Tool: Bnd-0.0.255
Bundle-Name: package-core
Created-By: Apache Maven Bundle Plugin
Build-Jdk: 1.7.0_65
Bundle-Version: 4.0.0.SNAPSHOT
Bnd-LastModified: 1435161944129
Bundle-ManifestVersion: 2
Bundle-Activator: bi.package.internal.ExampleActivator
Import-Package: bi.package.core.repository;version="4.0.0.SNAPSHOT",bi.package.core.repository.objects;version="4.0.0.SNAPSHOT",bi.meteorite.internal
Bundle-SymbolicName: package-core

So it appears its failing because it depends on itself? Clearly that is wrong, so where have I messed up?

1

There are 1 answers

1
Achim Nierbeck On BEST ANSWER

Your problem is this one:

Import-Package: ... bi.meteorite.internal

you import a package which isn't exported and you actually declared to be private:

Private-Package: bi.package.internal.*

Unless really needed it's usually best to not import your exported packages. This is only use-full if you export an embedded dependency which might be replaced with a newer version as standalone.