I develop a rich application based on JavaFX and the OSGi Felix container. When my JavaFX is started, an org.osgi.framework.BundleException is thrown indicating that the framwork could not wire my JavaFX packages :
ERROR: Bundle app-impl-bundle [3] Error starting eclipse-project:T:\workspace\fast-osgi\app-impl-bundle\ (org.osgi.framework.BundleException: Unresolved constraint in bundle app-impl-bundle [3]: Unable to resolve 3.0: missing requirement [3.0] osgi.wiring.package; (&(osgi.wiring.package=javafx.stage)(version>=2.2.0)))
Here my MANIFEST.MF file :
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: app-impl-bundle
Bundle-SymbolicName: app-impl-bundle
Bundle-Version: 1.0.0.qualifier
Require-Bundle: app-bundle;bundle-version="0.0.1"
Bundle-Activator: com.mycompany.app.impl.Activator
Import-Package: javafx.stage;version="2.2.0",
javax.xml.parsers,
org.osgi.framework;version="1.8.0",
org.w3c.dom,
org.xml.sax
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ClassPath: .,
target/lib/log4j-1.2.17.jar
And here the VM Arguments used to start the OSGi Framework (I run my project under Eclipse Luna, using this plugin) :
-Dosgi.requiredJavaVersion=1.8 -Dorg.osgi.framework.bundle.parent=ext
The last argument has no effect. In spite of this this article which tell that it works on Equinox...
I found a solution adding this option to the VM arguments :
-Dorg.osgi.framework.system.packages.extra=javafx.stage
But this is not very flexible.
Do you think Felix OSGi implementation is the problem ? Should it works only with Equinox ? Anyone can help me ? Is it the right way to do it ?