Set the current application in the Tide context in JavaFX OSGi application bundle - e(fx)clipse 4.4

31 views
Skip to first unread message

Y Borys

unread,
Jan 12, 2015, 7:58:35 AM1/12/15
to gran...@googlegroups.com
I am trying to run JavaFX app as OSGi application bundle using e(fx)clipse.
I have included Gds JavaFX client libraries in Manifest 
Bundle-ClassPath: .,
 lib
/validation-api-1.1.0.Final.jar,
 lib
/hibernate-validator-4.3.1.Final.jar,
 lib
/granite-client-javafx-advanced-3.1.1.GA.jar,
 lib
/granite-client-javafx-3.1.1.GA.jar

App module class
@Module
public class App {
 
@Singleton
 
public static ServerSession serverSession() {
 
ServerSession serverSession = new ServerSession("/hoserver", "localhost", 8080);      
        serverSession
.addRemoteAliasPackage("ferp.fx.client.core.app");
       
return serverSession;
 
}
}


application start method
public static SimpleContextManager contextManager;



protected void jfxStart(IApplicationContext applicationContext, Application jfxApplication, Stage primaryStage) {
 
 
MainApplicationActivator.getInstance().setApplication(this);
 
MainApplicationActivator.getInstance().getBundleContext().registerService(MainApplication.class, this, null);
 
 contextManager
= new SimpleContextManager(new JavaFXApplication(jfxApplication, primaryStage)); // <1>
    contextManager
.initModules(App.class); // <2>
    contextManager
.getContext().set(jfxApplication); // <3>   .set(this); dont work also
   
......
}

At points <1> and <2> there are not any problems.
At point <3> i got this error
java.lang.RuntimeException: Exception in Application start method
 at com
.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:875)
 at com
.sun.javafx.application.LauncherImpl.lambda$launchApplication$147(LauncherImpl.java:157)
 at com
.sun.javafx.application.LauncherImpl$$Lambda$1/80819202.run(Unknown Source)
 at java
.lang.Thread.run(Thread.java:745)
Caused by: org.granite.client.platform.PlatformConfigurationError: Could not create new Platform of type: org.granite.client.platform.Platform
 at org
.granite.client.platform.Platform.initInstance(Platform.java:130)
 at org
.granite.client.platform.Platform.initInstance(Platform.java:110)
 at org
.granite.client.platform.Platform.getInstance(Platform.java:69)
 at org
.granite.client.platform.Platform.persistence(Platform.java:257)
 at org
.granite.client.tide.data.impl.AbstractDataManager.initPersistence(AbstractDataManager.java:73)
 at org
.granite.client.tide.data.impl.AbstractDataManager.<init>(AbstractDataManager.java:69)
 at org
.granite.client.tide.data.impl.JavaBeanDataManager.<init>(JavaBeanDataManager.java:58)
 at org
.granite.client.tide.Context.<init>(Context.java:85)
 at org
.granite.client.tide.impl.SimpleContextManager.createContext(SimpleContextManager.java:143)
 at org
.granite.client.tide.impl.SimpleContextManager.getContext(SimpleContextManager.java:156)
 at org
.granite.client.tide.impl.SimpleContextManager.getContext(SimpleContextManager.java:134)
 at ferp
.fx.client.core.app.MainApplication.jfxStart(MainApplication.java:68)
 at org
.eclipse.fx.osgi.util.AbstractJFXApplication$JFXApp.start(AbstractJFXApplication.java:55)
 at com
.sun.javafx.application.LauncherImpl.lambda$launchApplication1$153(LauncherImpl.java:821)
 at com
.sun.javafx.application.LauncherImpl$$Lambda$50/2104624925.run(Unknown Source)
 at com
.sun.javafx.application.PlatformImpl.lambda$runAndWait$166(PlatformImpl.java:323)
 at com
.sun.javafx.application.PlatformImpl$$Lambda$46/1686657515.run(Unknown Source)
 at com
.sun.javafx.application.PlatformImpl.lambda$null$164(PlatformImpl.java:292)
 at com
.sun.javafx.application.PlatformImpl$$Lambda$48/543754500.run(Unknown Source)
 at java
.security.AccessController.doPrivileged(Native Method)
 at com
.sun.javafx.application.PlatformImpl.lambda$runLater$165(PlatformImpl.java:291)
 at com
.sun.javafx.application.PlatformImpl$$Lambda$47/1807316760.run(Unknown Source)
 at com
.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
 at com
.sun.glass.ui.win.WinApplication._runLoop(Native Method)
 at com
.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102)
 at com
.sun.glass.ui.win.WinApplication$$Lambda$38/1830220720.run(Unknown Source)
 
... 1 more
Caused by: java.lang.ClassNotFoundException: org.granite.client.platform.Platform
 at java
.net.URLClassLoader$1.run(URLClassLoader.java:372)
 at java
.net.URLClassLoader$1.run(URLClassLoader.java:361)
 at java
.security.AccessController.doPrivileged(Native Method)
 at java
.net.URLClassLoader.findClass(URLClassLoader.java:360)
 at java
.lang.ClassLoader.loadClass(ClassLoader.java:424)
 at java
.lang.ClassLoader.loadClass(ClassLoader.java:357)
 at org
.granite.client.platform.Platform.initInstance(Platform.java:126)
 
... 26 more

What's wrong i am doing?

Erguder Bekrek

unread,
Jan 12, 2015, 1:39:36 PM1/12/15
to gran...@googlegroups.com
GDS is not yet ready to be used for OSGi.
The libraries you are trying to use have to be osgified.

It's probably going to be available in future releases.

--

---
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "Granite Data Services Forum".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse graniteds+...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.



--
Erguder Bekrek

Développeur Flash/Flex ActionScript 2.0/3.0
514.728.5708
erguder...@gmail.com
Reply all
Reply to author
Forward
0 new messages