I've been trying to make an OSGI REST bundle. I've baked it down to a contrived minimized example with a single bundle workspace with a single class that uses a few annotations. I get errors resolving the javax.ws.rs package when I run the bundle through Eclipse. I have added the javax.ws.rs-api 2.0.1 to the cnf project and added the javax.ws.rs-api-2.0.1.jar to the build path of my bundle.
When I run the bundle I get the following error:
! could not resolve the bundles: [myprovider-1.0.0.201704280130 org.osgi.framework.BundleException: Unable to resolve myprovider [1](R 1.0): missing requirement [myprovider [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.ws.rs)(version>=2.0.0)(!(version>=3.0.0))) Unresolved requirements: [[myprovider [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.ws.rs)(version>=2.0.0)(!(version>=3.0.0)))] ] ! Failed to start bundle myprovider-1.0.0.201704280130, exception Unable to resolve myprovider [1](R 1.0): missing requirement [myprovider [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.ws.rs)(version>=2.0.0)(!(version>=3.0.0))) Unresolved requirements: [[myprovider [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.ws.rs)(version>=2.0.0)(!(version>=3.0.0)))]
My bundle's bnd.bnd is:
-buildpath: \
javax.ws.rs-api;version=2.0,\
osgi.cmpn,\
osgi.core
-runrequires: \
osgi.identity; filter:='(osgi.identity=org.apache.felix.gogo.command)',\
osgi.identity; filter:='(osgi.identity=org.apache.felix.gogo.runtime)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.shell)'
-runfw: org.apache.felix.framework;version='[5.4.0,5.4.0]'
-runee: JavaSE-1.8
Export-Package: myprovider
What I was originally trying to do is almost the same as in this question:
Error implementing a OSGI REST: `OSGi bundle not started : missing requirement`
However, the resolution to that issue is something I already have in my bnd file.