Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Fooling Equinox......
Fooling Equinox...... [message #1448633] Mon, 20 October 2014 08:03 Go to next message
Mouhammad Khier Abdoh is currently offline Mouhammad Khier AbdohFriend
Messages: 11
Registered: September 2014
Junior Member
Hi,
So for the last 6 months i have been working on JavaFx and OSGI (Equinox), but as separated Projects, and i have come to the point where i need to integrate these two techs together, so i have tried the two e(fx)clipse brilliant wizards
1- OSGI Application Project
2- OSGI Bundle Project
as a solution for this dilemma and i have come to this (feel obligated to correct me if wrong Twisted Evil Twisted Evil ) :

1- for the first wizard it is generating four projects which MR. Tom Schindl had explained in his blog http://tomsondev.bestsolution.at/2012/12/10/my-recommended-project-structure-for-javafx-e4-projects/, but when i looked at the Run Configuration of the launch i realized that it is running as an Eclipse Application index.php/fa/19585/0/, (and i need to start my system as an OSGI Framework), and notice this, there is a plug-in dependencies which looks like this index.php/fa/19586/0/, and the main class is extending an AbstractJFXApplication class and using an jfxStart method (not a standard JavaFX App)!!!! index.php/fa/19587/0/.
2- for the second wizard the generated project has the same structure as an plug-in development project (I SUPPOSE) adding the plug-in dependencies that looks like this index.php/fa/19588/0/.
Now i am using (eclipse-SDK-4.4-linux-gtk-x86_64-efx-1.0.0-SNAPSHOT) as a development Platform, when i try to run the second wizard generated project after adding simple stage-scene-anchorpane code to it , it works as a stand alone jar,BUT when i try to fire the whole system with Equinox System Bundle as an OSGI Framework i have errors regarding equinox not finding certain JavaFx Dependencies.

Now i kinda have a hint that Oracle didn't added the ((((JavaFx to the JRE Class-path)))) So Equinox Can't see it in run-time, and that led MR. Tom to develop those two wizards and using an adapter Hook to fool equinox.
and i need to develop Plug-in projects (Bundles) and have JavaFx Code in some of them, so the Questions that arises are:
Do i need to add the same Plug-in dependencies as in the first wizard? and HOW?
Any Thoughts Or Ideas are most and very welcome, any guidness or tutorials are most appreciated.
Thanks a lot.
Regards.
PS: if you are going to guide me to e4 apps, please explain Why and How? because i have a very bad experience with it, and the already done part of my project is written as plug-in development.
  • Attachment: image(1).png
    (Size: 197.29KB, Downloaded 633 times)
  • Attachment: image(2).png
    (Size: 134.32KB, Downloaded 504 times)
  • Attachment: image(3).png
    (Size: 143.47KB, Downloaded 611 times)
  • Attachment: image(4).png
    (Size: 102.35KB, Downloaded 532 times)
Re: Fooling Equinox...... [message #1448654 is a reply to message #1448633] Mon, 20 October 2014 08:44 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
On 20.10.14 10:03, Mouhammad Khier Abdoh wrote:
> Hi,
> So for the last 6 months i have been working on JavaFx and OSGI (Equinox), but as separated Projects, and i have come to the point where i need to integrate these two techs together, so i have tried the two e(fx)clipse brilliant wizards
> 1- OSGI Application Project
> 2- OSGI Bundle Project
> as a solution for this dilemma and i have come to this (feel obligated to correct me if wrong :twisted: :twisted: ) :
>
> 1- for the first wizard it is generating four projects which MR. Tom Schindl had explained in his blog http://tomsondev.bestsolution.at/2012/12/10/my-recommended-project-structure-for-javafx-e4-projects/, but when i looked at the Run Configuration of the launch i realized that it is running as an Eclipse Application , (and i need to start my system as an OSGI Framework),

I don't see what your heading to? You want to run on OSGi so why is it a
problem to start you need to start on OSGi-Framework?

and notice this, there is a plug-in dependencies which looks like this ,
and the main class is extending an AbstractJFXApplication class and
using an jfxStart method (not a standard JavaFX App)!!!! .

Right. We define an IApplication which can be launched:
a) through a command line param
b) interactively through the Console or Equinox APIs

> 2- for the second wizard the generated project has the same structure as an plug-in development project (I SUPPOSE) adding the plug-in dependencies that looks like this .
> Now i am using (eclipse-SDK-4.4-linux-gtk-x86_64-efx-1.0.0-SNAPSHOT) as a development Platform, when i try to run the second wizard generated project after adding simple stage-scene-anchorpane code to it , it works as a stand alone jar,BUT when i try to fire the whole system with Equinox System Bundle as an OSGI Framework i have errors regarding equinox not finding certain JavaFx Dependencies.
>

This wizard simply creates a Bundle which has the necessary
javafx-imports so that you not forget about one. We need to this javafx
imports because without it the whole wireing of our fake
org.eclipse.fx.javafx bundle with its adapter hooks won't work.

> Now i kinda have a hint that Oracle didn't added the ((((JavaFx to the JRE Class-path)))) So Equinox Can't see it in run-time, and that led MR. Tom to develop those two wizards and using an adapter Hook to fool equinox.

First of all: JavaFX2 was on no classpath, JavaFX8 is on the extension
classpath but Equinox by default does NOT consult that path.

The wizards are in no way fooling Equinox! What is fooling equinox is
the org.eclipse.fx.javafx & org.eclipse.fx.osgi bundles:
* org.eclipse.fx.javafx simply does the javafx.* exports so that
bundles who import it wire against it
* org.eclipse.fx.osgi hooks into the construction of the classloader
for org.eclipse.fx.javafx and creates one that delegates to one that
knows javafx

> and i need to develop Plug-in projects (Bundles) and have JavaFx Code in some of them, so the Questions that arises are:
> Do i need to add the same Plug-in dependencies as in the first wizard? and HOW?

You need at least the above 2 bundles.

Or as alternative *none of them* and *no* package imports for javafx
(this important! I repeat no package imports!) but launch Equinox with
-Dorg.osgi.framework.bundle.parent=ext which forces Equinox to NOT strip
the ext-classloader from the lookup hiearchy.

Tom
Re: Fooling Equinox...... [message #1448668 is a reply to message #1448654] Mon, 20 October 2014 09:06 Go to previous message
Mouhammad Khier Abdoh is currently offline Mouhammad Khier AbdohFriend
Messages: 11
Registered: September 2014
Junior Member
Thanks A lot MR.Tom, but i have certain foggy areas.

>> I don't see what your heading to? You want to run on OSGi so why is it a
problem to start you need to start on OSGi-Framework?
<< i am heading (and 50% chance i am wrong) to applying what i learned in OSGI Books which is making Run-Configurations as an OSGI-Framework and adding the bundles needed to start the system along the (org.eclipse.osgi) bundle

>> You need at least the above 2 bundles.
<< after adding those two bundles, do i need to configure something else, or import them else where in the code, and what about the writing technique can i use the standard way?
@Override
	public void start(Stage primaryStage) {	
	}


>> Or as alternative *none of them* and *no* package imports for javafx
(this important! I repeat no package imports!) but launch Equinox with
-Dorg.osgi.framework.bundle.parent=ext which forces Equinox to NOT strip
the ext-classloader from the lookup hiearchy.
<< Frankly and to be honest i didn't understood any of this (Newbie) So simple English PLEASE.

Thanks A lot you have been a great help
Regards
Mouhammad
Previous Topic:Drag and drop
Next Topic:CSS styling of MCompositePart
Goto Forum:
  


Current Time: Wed Feb 05 10:51:02 GMT 2025

Powered by FUDForum. Page generated in 0.02899 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top