Rxjava: OSGi install fails because sun.misc package is not exported via Felix

Created on 11 Nov 2015  路  4Comments  路  Source: ReactiveX/RxJava

Hi!, trying to install bundle I get this one
org.osgi.framework.BundleException: Unresolved constraint in bundle io.reactivex.rxjava [274]: Unable to resolve 274.0: missing requirement [274.0] package; (package=sun.misc)
at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3409)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1709)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:905)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:892)

I see there is fallback implemented in src if Unsafe is unavailable,
but in MANIFEST.MF package sun.misc is still strongly required.
It would be nice to make resolution:=optional for this package because its absence breaks nothing inside

Question

Most helpful comment

To append packages to the default set of exported system packages add needed value to this propertie:
org.osgi.framework.system.packages.extra=sun.misc

All 4 comments

To append packages to the default set of exported system packages add needed value to this propertie:
org.osgi.framework.system.packages.extra=sun.misc

It is wrong way. This package is not public any way. And that package import is really optional - I see there is fallback implemented already)

You can also fix this by adding com.diffplug.osgi:com.diffplug.osgi.extension.sun.misc:0.0.0 from MavenCentral. See here for more details on extension bundles.

Thanks for the help @2686747 and @nedtwigg !

Was this page helpful?
0 / 5 - 0 ratings