Error When Running Example

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Error When Running Example

gmseed
Hi
I built the example given at the following webpage into Eclipse:

https://gouessej.wordpress.com/2020/04/05/javafx-et-jogl-fonctionnent-ensemble-javafx-and-jogl-work-together/

but when I run it, I get the following runtime stacktrace pasted below:

Any ideas what is wrong?

I'm using Java11, the latest JFX and JOGAMP fat jar is described on the webpage and on Linux Mint 21 using Eclipse 2022.

Thanks

Exception in Application start method

(java:29350): Gdk-WARNING **: 13:56:27.330: XSetErrorHandler() called with a GDK error trap pushed. Don't do that.
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:464)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1071)
Caused by: java.lang.RuntimeException: Exception in Application start method
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:900)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.InternalError: XXX0 profile[2]: GL2 -> profileImpl GL3bc !!! not mapped
        at com.jogamp.opengl.GLProfile.computeProfileMap(GLProfile.java:2098)
        at com.jogamp.opengl.GLProfile.initProfilesForDeviceCritical(GLProfile.java:1976)
        at com.jogamp.opengl.GLProfile.initProfilesForDevice(GLProfile.java:1895)
        at com.jogamp.opengl.GLProfile.initProfilesForDefaultDevices(GLProfile.java:1861)
        at com.jogamp.opengl.GLProfile.access$000(GLProfile.java:80)
        at com.jogamp.opengl.GLProfile$1.run(GLProfile.java:239)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at com.jogamp.opengl.GLProfile.initSingleton(GLProfile.java:225)
        at com.jogamp.opengl.GLProfile.getProfileMap(GLProfile.java:2324)
        at com.jogamp.opengl.GLProfile.get(GLProfile.java:1042)
        at com.jogamp.opengl.GLProfile.get(GLProfile.java:1071)
        at com.jogamp.opengl.GLProfile.getMaxFixedFunc(GLProfile.java:824)
        at org.jogamp.joglojfx.App.start(App.java:38)
        at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
        at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
        at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
        at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
        ... 1 more
Exception running application org.jogamp.joglojfx.App
Reply | Threaded
Open this post in threaded view
|

Re: Error When Running Example

gmseed
I took the command-line generated by Eclipse and ran it in a terminal:

/usr/lib/jvm/java-11-openjdk-amd64/bin/java --module-path /usr/share/openjfx/lib --add-modules javafx.controls --add-opens javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED --add-opens javafx.graphics/javafx.stage=ALL-UNNAMED --add-opens javafx.graphics/com.sun.javafx.tk.quantum=ALL-UNNAMED --add-opens javafx.graphics/com.sun.glass.ui=ALL-UNNAMED -Dfile.encoding=UTF-8 -p /usr/share/openjfx/lib/javafx.base.jar:/usr/share/openjfx/lib/javafx.controls.jar:/usr/share/openjfx/lib/javafx.fxml.jar:/usr/share/openjfx/lib/javafx.graphics.jar:/usr/share/openjfx/lib/javafx.media.jar:/usr/share/openjfx/lib/javafx.swing.jar:/usr/share/openjfx/lib/javafx.web.jar -classpath /home/gmseed/eclipse-workspace/JOGL_JavaFX/bin:/home/gmseed/programming/libs/jogl/jogamp/jogamp-fat.jar org.jogamp.joglojfx.App

and it worked, but still issued the warning:

(java:31236): Gdk-WARNING **: 14:25:33.909: XSetErrorHandler() called with a GDK error trap pushed. Don't do that.

However, I'm still left wondering why it won't run in Eclipse, when using Eclipse's own generated cmd-line command!!

After a bit of googling I found this related post:

https://groups.google.com/g/jaamsim-users/c/tJW48U0Vi9k?pli=1

and tried adding:

export LIBGL_ALWAYS_SOFTWARE=1

to my bashrc, but it made no difference to the Eclipse run.
Reply | Threaded
Open this post in threaded view
|

Re: Error When Running Example

gmseed
Found a related post:

https://jogamp.org/bugzilla/show_bug.cgi?id=1426

Looks like I need to do a Windows build to see if it goes away and a known Linux issue.
Reply | Threaded
Open this post in threaded view
|

Re: Error When Running Example

gouessej
Administrator
Hello

I wrote this example and it works under Mageia Linux.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Error When Running Example

gouessej
Administrator
In reply to this post by gmseed
Maybe using a more recent release candidate will help. I'll update the link if necessary.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Error When Running Example

gouessej
Administrator
In reply to this post by gmseed
Which version of OpenJFX do you use? The command line generated by Eclipse is a bit crappy, it uses both the module path and the classpath to load OpenJFX classes which might work but it's not correct.

Please indicate which GPU you use, maybe there's a workaround in a more recent release candidate.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Error When Running Example

gmseed
In reply to this post by gouessej
The one I downloaded was, as specified in your article:

https://jogamp.org/deployment/v2.4.0-rc-20210111/fat/jogamp-fat.jar

and looking inside the manifest I have:

...
Implementation-Title: JogAmp Java Bindings Fat Jar
Implementation-Version: 2.4.0-rc-20210111
Implementation-Build: 2.4-b938-20210111
...

Looking under:

https://jogamp.org/deployment/

it seems that v2.4.0-rc-20210111 is the most up to date.
Reply | Threaded
Open this post in threaded view
|

Re: Error When Running Example

gmseed
In reply to this post by gouessej
From the javafx.properties file:

javafx.version=11.0.10-internal
javafx.runtime.version=11.0.10-internal+0-2021-02-03-151839
javafx.runtime.build=0

I also noted the -p option in the Eclipse generated command-line command. This is in fact unnecessary and works on the cmd-line by dropping it; ie:

/usr/lib/jvm/java-11-openjdk-amd64/bin/java --module-path /usr/share/openjfx/lib --add-modules javafx.controls --add-opens javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED --add-opens javafx.graphics/com.sun.javafx.tk.quantum=ALL-UNNAMED --add-opens javafx.graphics/com.sun.glass.ui=ALL-UNNAMED --add-opens javafx.graphics/javafx.stage=ALL-UNNAMED -classpath /home/gmseed/eclipse-workspace/JOGL_JavaFX/bin:/home/gmseed/programming/libs/jogl/jogamp/jogamp-fat.jar org.jogamp.joglojfx.App

However, still not been able to get things to run under Eclipse.

As far as I can tell, the card is:

1:00.0 VGA compatible controller: NVIDIA Corporation GK107M [GeForce GT 640M] (rev a1)
Reply | Threaded
Open this post in threaded view
|

Re: Error When Running Example

gmseed
In reply to this post by gmseed
BTW - I did a Windows10 build again using Eclipse 2022, OpenJFX 18, Java 17, JOGAMP v2.4.0--rc and it ran via Eclipse without any issues and warnings.
Reply | Threaded
Open this post in threaded view
|

Re: Error When Running Example

gouessej
Administrator
I think that I have never used OpenJFX 11 under GNU Linux, it's too old. I used at least OpenJFX 14.
Julien Gouesse | Personal blog | Website