OSGi bundle not started : missing requirement osgi.wiring.package; > &(osgi.wiring.package=org.apache.felix.dm)

mu_sa picture mu_sa · May 17, 2015 · Viewed 17.4k times · Source

I have been trying to follow 'Building Modular Cloud Apps with OSGi'. In chapter 3 of the book 'Creating the first OSGi application' the author describes how to create a simple OSGi application with a service in eclipse with bndtools.

Below is the screenshot of my classes and configurations.

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

The problem I am facing is

'! could not resolve the bundles: [agenda.service.simple-0.0.1Unresolved constraint in bundle agenda.service.simple [9]: Unable to resolve 9.0: missing requirement [9.0] osgi.wiring.package; (&(osgi.wiring.package=org.apache.felix.dm)(version>=3.0.0)(!(version>=4.0.0)))

] ! Failed to start bundle agenda.service.simple-0.0.1, exception Unresolved constraint in bundle agenda.service.simple [9]: Unable to resolve 9.0: missing requirement [9.0] osgi.wiring.package; (&(osgi.wiring.package=org.apache.felix.dm)(version>=3.0.0)(!(version>=4.0.0))) ____________________________'

Also, when i try to issue a command in the gogo shell that also doesnt input corretly sometimes. But eventually when it does the bundle status looks like

g! lb gogo: CommandNotFoundException: Command not found: b

g! lb gogo: CommandNotFoundException: Command not found: llb

g!

g!

g!

g!

g!

g!

lb START LEVEL 1 ID|State |Level|Name

0|Active     |    0|System Bundle (4.0.3)

1|Active     |    1|Apache Felix Dependency Manager (4.0.1)

2|Active     |    1|Apache Felix Dependency Manager Shell (4.0.1)

3|Active     |    1|Apache Felix Gogo Command (0.14.0)

4|Active     |    1|Apache Felix Gogo Runtime (0.10.0)

5|Active     |    1|Apache Felix Gogo Runtime (0.12.1)

6|Active     |    1|Apache Felix Gogo Shell (0.10.0)

7|Active     |    1|osgi.cmpn (5.0.0.201305092017)

8|Active     |    1|agenda.api (0.0.0.201505171119)

9|Installed  |    1|agenda.service.simple (0.0.1)

Answer

AndyL picture AndyL · May 17, 2015

Your agenda.service.simple bundle is looking for a bundle that exports a version of org.apache.felix.dm between 3.0.0 and 4.0.0, but it is only finding the 4.0.1 version that the Apache Felix Dependency Manager exports.

Typically this would be caused by compiling against a different version of felix than you are running against.