I am trying to add a new OSGI bundle in Felix (without Karaf) as an ActiveMQ client (message sender).
The ActiveMQ client works nicely in non-OSGI environment. But when I use the same code (with some small modification) in Felix, it throws this error:
org.osgi.framework.BundleException: Unable to resolve com.packtpub.felix.bookshelf-inventory-impl-mock [7](R 7.3): missing requirement [com.packtpub.felix.bookshelf-inventory-impl-mock [7](R 7.3)] osgi.wiring.package; (&(osgi.wiring.package=javax.jms)(version>=1.1.0)) Unresolved requirements: [[com.packtpub.felix.bookshelf-inventory-impl-mock [7](R 7.3)] osgi.wiring.package; (&(osgi.wiring.package=javax.jms)(version>=1.1.0))]
Any help is very much appreciated.
Unpacking the message gives you the message loud and clear:
Unable to resolve com.packtpub.felix.bookshelf-inventory-impl-mock[7]
Bundle 7 (com.packtpub.felix.bookshelf-inventory-impl-mock) has a problem
(R 7.3): missing requirement
You had some updates and bundle 7 is on the third revision. Not that relevant here to know though :-)
osgi.wiring.package;
You're missing a package (osgi.wiring.package is the OSGi namespace for Import/Export Package headers.)
(&(osgi.wiring.package=javax.jms)(version>=1.1.0))
This is an LDAP/OSGi filter. Lets unpack it:
osgi.wiring.package=javax.jms
It is looking for package javax.jms
version>=1.1.0
And the version should be more or equal to 1.1.0
The package javax.jms
is a Java EE package and not part of the JRE. You need to find a bundle that exports it (with the proper version). Since you compiled the code you must already have it in your build. Find that bundle and also deploy it to your framework.