You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Eelco Meuter <ee...@wur.nl> on 2009/06/05 10:02:49 UTC

how to use javafx in an embedded felix app

Hi felix users,

A couple of weeks I posted a question named 'Felix and javaFX/third  
party jars'. I found a solution, which I report here in hope it will  
be helpful. Please feel free to comment the taken approach. This will  
improve my coding/ OSGi skills :)

JavaFX (JFX) uses reflection to instantiate FX classes. As each bundle  
has its own class loader, classes were not found. It was reported to  
set the com.sun.tools.javafx.script.classpath system property or set  
the classpath attribute in a ScriptContext instance. The latter was  
not helpful as the BundleActivator is already a JFX class, not a POJO  
and I have no clue to implement the first. So, I took the approach to  
bundle the JFX SDK as an extension bundle to system.bundle and  
configure felix to auto-activate the wrapped JFX SDK. This works well  
apart from the fact that the same issue arises for my own JFX  
packages. I did the same trick. I bundled my own JFX packages as an  
extension bundle to system.bundle and the JFX bundle activator as a  
plain bundle. This solution works well, although I prefer to see the  
JFX packages and the activator in the same bundle. Maybe that is a  
puzzle for the next JFX release...

regards,

Eelco


Wageningen University
Plant Production Systems
P.O. Box 430
6700 AK WAGENINGEN
The Netherlands
http://www.pps.wur.nl






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org