Home » Eclipse Projects » e(fx)clipse » Works with Java 7, but not Java 8
Works with Java 7, but not Java 8 [message #1464270] |
Fri, 07 November 2014 11:16  |
Eclipse User |
|
|
|
Howdy,
I have a strange situation: I have an Eclipse application that is built on Luna, although it contains a number of RCP3 components. I need only one JavaFX element, the HTML Editor, specifically javafx.scene.web.HTMLEditor.
And this works fine with Java 7. But if I use Java 8, it does not: And there is no error message, nothing. The application just hangs.
Worse, I cannot even troubleshoot it, because it works fine in the IDE. The problem only appears in the Maven built (via Tycho).
I first want to verify that I include the correct feature. I am currently using this update site:
http://download.eclipse.org/efxclipse/runtime-released/1.0.0/site
And I include org.eclipse.fx.runtime.feature
Any thought...? Do I need anything that Tycho may not be aware of, that I need to add as an explicit dependency?
Thanks!
- Michael
|
|
|
Re: Works with Java 7, but not Java 8 [message #1464309 is a reply to message #1464270] |
Fri, 07 November 2014 12:05   |
Eclipse User |
|
|
|
Ok - so you are embedding JavaFX into SWT using FXCanvas? The first
thing to look at to turn on the logging for the OSGi-Adapter-Hooks by
starting with "-Defxclipse.osgi.hook.debug=true" (e.g. modify your
eclipse.ini).
The 2nd thing I'd try is to get a thread dump, e.g. by connecting a
debugger to the external launched application or getting through other
means [1].
Tom
[1]https://wiki.eclipse.org/How_to_report_a_deadlock
On 07.11.14 12:16, Michael Jastram wrote:
> Howdy,
>
> I have a strange situation: I have an Eclipse application that is built
> on Luna, although it contains a number of RCP3 components. I need only
> one JavaFX element, the HTML Editor, specifically
> javafx.scene.web.HTMLEditor.
> And this works fine with Java 7. But if I use Java 8, it does not: And
> there is no error message, nothing. The application just hangs.
>
> Worse, I cannot even troubleshoot it, because it works fine in the IDE.
> The problem only appears in the Maven built (via Tycho).
>
> I first want to verify that I include the correct feature. I am
> currently using this update site:
>
> http://download.eclipse.org/efxclipse/runtime-released/1.0.0/site
>
> And I include org.eclipse.fx.runtime.feature
>
> Any thought...? Do I need anything that Tycho may not be aware of, that
> I need to add as an explicit dependency?
>
> Thanks!
>
> - Michael
|
|
|
Re: Works with Java 7, but not Java 8 [message #1464332 is a reply to message #1464309] |
Fri, 07 November 2014 12:32   |
Eclipse User |
|
|
|
Hi Tom,
Thanks for the quick response!
> The first thing to look at to turn on the logging
That got me a huge step forward: The dreaded NoClassDefFoundError - I had that one before. I'll start troubleshooting - but should you know the answer right out of your head, I'll keep listening here! 
Thanks again,
- Michael
Log:
!ENTRY org.eclipse.ui 4 0 2014-11-07 13:28:00.387
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NoClassDefFoundError: javafx/embed/swt/FXCanvas
at com.formalmind.rmf.reqif10.pror.presentation.rtf.ui.XhtmlCellEditor.createContents(XhtmlCellEditor.java:299)
at com.formalmind.rmf.reqif10.pror.presentation.rtf.ui.XhtmlCellEditor.openPopupBox(XhtmlCellEditor.java:415)
at org.agilemore.agilegrid.editors.PopupCellEditor.activate(PopupCellEditor.java:115)
at org.agilemore.agilegrid.AgileGridEditor.activateCellEditor(AgileGridEditor.java:257)
at org.agilemore.agilegrid.AgileGridEditor.handleEditorActivationEvent(AgileGridEditor.java:425)
at org.agilemore.agilegrid.AgileGridEditor.onMouseEvent(AgileGridEditor.java:207)
at org.agilemore.agilegrid.AgileGridEditor$2.mouseDoubleClick(AgileGridEditor.java:183)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:196)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4486)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3831)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3441)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: java.lang.ClassNotFoundException: javafx.embed.swt.FXCanvas cannot be found by com.formalmind.rmf.reqif10.pror.presentation.rtf_0.11.0.201411061520
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:423)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:328)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 35 more
|
|
|
Re: Works with Java 7, but not Java 8 [message #1464373 is a reply to message #1464332] |
Fri, 07 November 2014 13:26   |
Eclipse User |
|
|
|
It looks like the adapter hooks are not loaded!
so you need to make sure that:
a) the org.eclipse.fx.osgi fragment is loaded
b) your config.ini has the necessary entry similar to
osgi.framework.extensions=reference\:file\:org.eclipse.osgi.compatibility.state_1.0.0.v20140403-1907.jar,reference\:file\:org.eclipse.fx.osgi_1.1.0.201411050602.jar
You version should be 1.0.0! You can check that by starting with -console
Tom
On 07.11.14 13:32, Michael Jastram wrote:
> Hi Tom,
>
> Thanks for the quick response!
>
>> The first thing to look at to turn on the logging
>
> That got me a huge step forward: The dreaded NoClassDefFoundError - I
> had that one before. I'll start troubleshooting - but should you know
> the answer right out of your head, I'll keep listening here! :)
>
> Thanks again,
>
> - Michael
>
> Log:
>
> !ENTRY org.eclipse.ui 4 0 2014-11-07 13:28:00.387
> !MESSAGE Unhandled event loop exception
> !STACK 0
> java.lang.NoClassDefFoundError: javafx/embed/swt/FXCanvas
> at
> com.formalmind.rmf.reqif10.pror.presentation.rtf.ui.XhtmlCellEditor.createContents(XhtmlCellEditor.java:299)
>
> at
> com.formalmind.rmf.reqif10.pror.presentation.rtf.ui.XhtmlCellEditor.openPopupBox(XhtmlCellEditor.java:415)
>
> at
> org.agilemore.agilegrid.editors.PopupCellEditor.activate(PopupCellEditor.java:115)
>
> at
> org.agilemore.agilegrid.AgileGridEditor.activateCellEditor(AgileGridEditor.java:257)
>
> at
> org.agilemore.agilegrid.AgileGridEditor.handleEditorActivationEvent(AgileGridEditor.java:425)
>
> at
> org.agilemore.agilegrid.AgileGridEditor.onMouseEvent(AgileGridEditor.java:207)
>
> at
> org.agilemore.agilegrid.AgileGridEditor$2.mouseDoubleClick(AgileGridEditor.java:183)
>
> at
> org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:196)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4486)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1388)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3831)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3441)
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
>
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
>
> at
> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
>
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>
> at
> org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
> at
> org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:236)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
> at java.lang.reflect.Method.invoke(Method.java:483)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
> Caused by: java.lang.ClassNotFoundException: javafx.embed.swt.FXCanvas
> cannot be found by
> com.formalmind.rmf.reqif10.pror.presentation.rtf_0.11.0.201411061520
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:423)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336)
>
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:328)
>
> at
> org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
>
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> ... 35 more
|
|
|
Re: Works with Java 7, but not Java 8 [message #1466887 is a reply to message #1464373] |
Sun, 09 November 2014 16:09   |
Eclipse User |
|
|
|
Hi Tom,
Thanks for the help, but I am still banging my head against the wall.
> so you need to make sure that:
> a) the org.eclipse.fx.osgi fragment is loaded
I explicitly added it as a plug-in to be packaged in my feature. At runtime, it is listed via About | Installation Details. Also, org.eclipse.osgi.compatibility.state is loaded as well.
> b) your config.ini has the necessary entry similar to
> osgi.framework.extensions=reference\:file\:org.eclipse.osgi.compatibility.state_1.0.0.v20140403-1907.jar,reference\:file\:org.eclipse.fx.osgi_1.1.0.201411050602.jar
I played around with this, but the syntax does not seem to work (of course I fixed the version numbers). Two thoughts:
(1) In the tutorial, you use this syntax:
-Dosgi.framework.extensions=org.eclipse.fx.osgi
And this worked for me in the past (both with 0.9.0 and the nightly build). I extended this with org.eclipse.osgi.compatibility.state, but this did not help.
(2) I just upgraded to 1.1.0, but I could not get it to work, either. Just for the record, this worked fine while I was using this update site:
<unit id="org.eclipse.fx.runtime.min.feature.feature.group" version="1.0.0.201409241226"/>
<repository location="http://download.eclipse.org/efxclipse/runtime-shared-nightly/site/"/>
But of course, I had to change the target platform before every maven built, as this update site changed, well, nightly. I used this before the 1.0 release, but I would prefer a stable built. And that one did not work with Java 8, just Java 7.
Any thoughts? Thanks!
- Michael
|
|
|
Re: Works with Java 7, but not Java 8 [message #1467102 is a reply to message #1466887] |
Sun, 09 November 2014 20:28   |
Eclipse User |
|
|
|
Hi Tom,
My bad - I missed an important hint you gave: -Defxclipse.osgi.hook.debug=true
This produces some insight - it's my Linux/GTK3 that's the problem. This would actually explain why I had relatively frequent application crashes. Is there anything I can do?
== JAVA 8 Console Output ==
FXClassLoader#createJREBundledClassloader - Started
FXClassLoader#createJREBundledClassloader - Assumed location (Java 8/Java 7): /home/jastram/opt/jdk1.8.0_11/jre/lib/ext/jfxrt.jar
FXClassLoader#createJREBundledClassloader - SWT is available use different loading strategy
FXClassLoader#createJREBundledClassloader - Searching for SWT-FX integration at /home/jastram/opt/jdk1.8.0_11/jre/lib/jfxswt.jar
FXClassLoader#createJREBundledClassloader - Found SWT/FX
FXClassLoader#createJREBundledClassloader - Delegate to system classloader
FXClassLoader.SWTFXClassloader#init - Primary Loader sun.misc.Launcher$ExtClassLoader@48548e3c
FXClassLoader.SWTFXClassloader#init - Lastresort Loader org.eclipse.osgi.internal.loader.EquinoxClassLoader@517566b[org.eclipse.swt:3.103.0.v20140605-2008(id=209)]
FXClassLoader#createJREBundledClassloader - Ended
FXModuleClassloader#findLocalClass trying to load class 'javafx.scene.Node'
FXModuleClassloader#findLocalClass trying to load class 'javafx.scene.image.ImageView'
FXModuleClassloader#findLocalClass trying to load class 'javafx.event.EventHandler'
FXModuleClassloader#findLocalClass trying to load class 'javafx.scene.Parent'
FXModuleClassloader#findLocalClass trying to load class 'javafx.scene.web.HTMLEditor'
FXModuleClassloader#findLocalClass trying to load class 'javafx.embed.swt.FXCanvas'
FXModuleClassloader#findLocalClass - Someone is trying to load FXCanvas. Need to check for GTK3
FXModuleClassloader#findLocalClass trying to load class 'org.eclipse.swt.SWT'
FXClassLoader.SWTFXClassloader#findClass - Loading org.eclipse.swt.SWT with primary
FXClassLoader.SWTFXClassloader#findClass - ClassNotFoundException thrown
FXClassLoader.SWTFXClassloader#findClass - Loading org.eclipse.swt.SWT with last resort
FXClassLoader.SWTFXClassloader#findClass - Result org.eclipse.swt.SWT class org.eclipse.swt.SWT
FXModuleClassloader#findLocalClass - We are on GTK need to take a closer look
FXModuleClassloader#findLocalClass trying to load class 'org.eclipse.swt.internal.gtk.OS'
FXClassLoader.SWTFXClassloader#findClass - Loading org.eclipse.swt.internal.gtk.OS with primary
FXClassLoader.SWTFXClassloader#findClass - ClassNotFoundException thrown
FXClassLoader.SWTFXClassloader#findClass - Loading org.eclipse.swt.internal.gtk.OS with last resort
FXClassLoader.SWTFXClassloader#findClass - Result org.eclipse.swt.internal.gtk.OS class org.eclipse.swt.internal.gtk.OS
FXModuleClassloader#findLocalClass - We are on GTK3 - too bad need to disable JavaFX for now else we'll crash the JVM
== JAVA 7 Console Output ==
Quote:FXClassLoader#createJREBundledClassloader - Started
FXClassLoader#createJREBundledClassloader - Assumed location (Java 8/Java 7): /usr/lib/jvm/java-7-oracle/jre/lib/ext/jfxrt.jar
FXClassLoader#createJREBundledClassloader - Assumed location (Java 7): /usr/lib/jvm/java-7-oracle/jre/lib/jfxrt.jar
FXClassLoader#createJREBundledClassloader - Ended
FXModuleClassloader#findLocalClass trying to load class 'javafx.scene.Node'
FXModuleClassloader#findLocalClass trying to load class 'javafx.scene.image.ImageView'
FXModuleClassloader#findLocalClass trying to load class 'javafx.event.EventHandler'
FXModuleClassloader#findLocalClass trying to load class 'javafx.scene.Parent'
FXModuleClassloader#findLocalClass trying to load class 'javafx.scene.web.HTMLEditor'
FXModuleClassloader#findLocalClass trying to load class 'javafx.embed.swt.FXCanvas'
FXModuleClassloader#findLocalClass - Someone is trying to load FXCanvas. Need to check for GTK3
FXModuleClassloader#findLocalClass trying to load class 'org.eclipse.swt.SWT'
FXModuleClassloader#findLocalClass - We are on GTK need to take a closer look
FXModuleClassloader#findLocalClass trying to load class 'org.eclipse.swt.internal.gtk.OS'
FXModuleClassloader#findLocalClass - We are on GTK3 - too bad need to disable JavaFX for now else we'll crash the JVM
Thanks,
- Michael
|
|
|
Re: Works with Java 7, but not Java 8 [message #1467112 is a reply to message #1467102] |
Sun, 09 November 2014 20:36   |
Eclipse User |
|
|
|
Hi Tom,
Okay, never mind, problem solved. setting SWT_GTK3=0 did the trick.
In case you're interested: I used that for launching Eclipse (that's why it worked out of the dev environment), and I also had a shortcut using it, making me think that it worked in the past. But I had forgotten about it, costing me hours of debugging. My bad. 
Anyway, thanks again for your quick responses, and I'll leave you alone (at least for now). 
Best,
- Michael
|
|
|
Re: Works with Java 7, but not Java 8 [message #1467691 is a reply to message #1467112] |
Mon, 10 November 2014 08:19   |
Eclipse User |
|
|
|
It would be better to use launcher switch "--launcher.GTK_version 2"
because without that your users have to set the env-var themselves.
Tom
On 09.11.14 21:36, Michael Jastram wrote:
> Hi Tom,
>
> Okay, never mind, problem solved. setting SWT_GTK3=0 did the trick.
>
> In case you're interested: I used that for launching Eclipse (that's why
> it worked out of the dev environment), and I also had a shortcut using
> it, making me think that it worked in the past. But I had forgotten
> about it, costing me hours of debugging. My bad. :(
>
> Anyway, thanks again for your quick responses, and I'll leave you alone
> (at least for now). :)
>
> Best,
>
> - Michael
|
|
|
Re: Works with Java 7, but not Java 8 [message #1467712 is a reply to message #1467691] |
Mon, 10 November 2014 08:40  |
Eclipse User |
|
|
|
Hi Tom,
> It would be better to use launcher switch "--launcher.GTK_version 2"
OMG - this is what I had been looking for all along. Works great! When I researched this way back then, I only encountered the environment variable as a solution. At that time Luna was not out yet. So I wonder whether this was not yet available in Kepler.
Either way, thanks so much.
Best,
- Michael
|
|
|
Goto Forum:
Current Time: Thu Feb 13 14:11:57 GMT 2025
Powered by FUDForum. Page generated in 0.08374 seconds
|