diffplug / osgiX

Expose the entire JRE to OSGi using extension bundles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using this tool when sun.misc is required by an embedded dependency

alanfranz opened this issue · comments

Hello,
I'm experiencing the "Missing imported package sun.misc_0.0.0." and I found your project in the RxJava issue tracker.

I'm creating an OSGI bundle via maven-scr-plugin; my OSGI bundle started exposing such issue when I wanted to add Guava as a dependency and I wanted to include it in my bundle via EmbedDependency, and that library depends on sun.misc.

So, I tried adding your jar as dependency in my pom.xml, and I even tried to add to EmbedDependency, but the error persists; if I check my MANIFEST.MF, it seems that sun.misc is NOT added to the automatically-generated Export-Package, while all my other dependencies' exports are correctly there.

Am I doing something wrong? Is there anything different that I should do? Please be aware: while I've got a lot of Java experience, I'm a bit of an OSGi newbie.

Is there anything different that I should do?

When you run an OSGi runtime, you pass it a set of jars. In Equinox/Eclipse, it's all the jars that live in the "plugins" folder. Other runtimes have other ways of defining the "universe" of jars.

You need to make sure that the OsgiX jar is in that universe of jars that the Osgi container runs. I don't know anything about maven or maven-scr-plugin, but adding OsgiX as a dependency of a library will not work. It needs to be available to the OSGi runtime.

Got it... so I was using it the wrong way. Thanks.