freddieFishCake
Posts: 1
Joined: Sun Jul 28, 2019 7:53 am

Error initializing pipeline com.sun.prism.es2.ES2Pipeline on raspberry Pi 4 / Debian Buster

Sun Jul 28, 2019 7:57 am

Hi,

I am trying to run a home-brew JavaFX application on a Raspberry Pi 4 with the latest raspbian / Buster. The application runs fine on raspberry Pi 3 with Java 8 and openjfx overlay.

On the new Pi 4 I installed the latest Buster lite, upgraded everything and the installed the latest openjdk runtime:
$ sudo apt search openjdk
default-jre/stable,now 2:1.11-71+b1 armhf [installed]
Standard Java or Java compatible Runtime

default-jre-headless/stable,now 2:1.11-71+b1 armhf [installed,automatic]
Standard Java or Java compatible Runtime (headless)

$ java --version
openjdk 11.0.3 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-post-Raspbian-5)
OpenJDK Server VM (build 11.0.3+7-post-Raspbian-5, mixed mode)

and the latest openjfx:
$ sudo apt search openjfx
libopenjfx-java/stable,now 11.0.2+1-1 all [installed,automatic]
JavaFX/OpenJFX - Rich client application platform for Java (Java libraries)

libopenjfx-jni/stable,now 11.0.2+1-1 armhf [installed,automatic]
JavaFX/OpenJFX - Rich client application platform for Java (native libraries)

Initial attempts to run a JavaFX application led to errors about there being two 'versions' of the javafx modules:

Error occurred during initialization of boot layer
java.lang.module.FindException: Two versions of module javafx.graphics found in /usr/share/java (javafx-graphics.jar and javafx-graphics-11.jar)

Seems to be related to linking within the /usr/share/java folder:
ls -l /usr/share/java
total 9804
-rw-r--r-- 1 root root 35266 Apr 4 21:51 java-atk-wrapper.jar
-rw-r--r-- 1 root root 2989 Dec 30 2018 java_defaults.mk
-rw-r--r-- 1 root root 845590 Jan 20 2019 javafx-base-11.jar
lrwxrwxrwx 1 root root 18 Jan 20 2019 javafx-base.jar -> javafx-base-11.jar
-rw-r--r-- 1 root root 2761851 Jan 20 2019 javafx-controls-11.jar
lrwxrwxrwx 1 root root 22 Jan 20 2019 javafx-controls.jar -> javafx-controls-11.jar
-rw-r--r-- 1 root root 143908 Jan 20 2019 javafx-fxml-11.jar
lrwxrwxrwx 1 root root 18 Jan 20 2019 javafx-fxml.jar -> javafx-fxml-11.jar
-rw-r--r-- 1 root root 5012429 Jan 20 2019 javafx-graphics-11.jar
lrwxrwxrwx 1 root root 22 Jan 20 2019 javafx-graphics.jar -> javafx-graphics-11.jar
-rw-r--r-- 1 root root 294778 Jan 20 2019 javafx-media-11.jar
lrwxrwxrwx 1 root root 19 Jan 20 2019 javafx-media.jar -> javafx-media-11.jar
-rw-r--r-- 1 root root 135736 Jan 20 2019 javafx-swing-11.jar
lrwxrwxrwx 1 root root 19 Jan 20 2019 javafx-swing.jar -> javafx-swing-11.jar
-rw-r--r-- 1 root root 785953 Jan 20 2019 javafx-web-11.jar
lrwxrwxrwx 1 root root 17 Jan 20 2019 javafx-web.jar -> javafx-web-11.jar
-rw-r--r-- 1 root root 2611 Nov 10 2018 libintl.jar

So I manually removed the links, and now I get a bit further in the sense that the fx modules are resolved and the prism_es2 library is loaded, but the pipeline initialisation fails with the following:

sudo java --module-path /usr/share/java/ --add-modules javafx.controls,javafx.fxml -Dprism.verbose=true -jar photo-slideshow-MASTER-SNAPSHOT.jar
Prism pipeline init order: es2 sw
Using Double Precision Marlin Rasterizer
Using dirty region optimizations
Not using texture mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.es2.ES2Pipeline
Loading ES2 native library ... prism_es2
succeeded.
GLFactory using com.sun.prism.es2.X11GLFactory
(X) Got class = class com.sun.prism.es2.ES2Pipeline
GraphicsPipeline.createPipeline: error initializing pipeline com.sun.prism.es2.ES2Pipeline
*** Fallback to Prism SW pipeline
Prism pipeline name = com.sun.prism.sw.SWPipeline
(X) Got class = class com.sun.prism.sw.SWPipeline
Initialized prism pipeline: com.sun.prism.sw.SWPipeline
Exception in thread "main" 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 java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.UnsupportedOperationException: Unable to open DISPLAY
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$new$6(GtkApplication.java:173)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:171)
at javafx.graphics/com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:41)
at javafx.graphics/com.sun.glass.ui.Application.run(Application.java:144)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:258)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:269)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)

Some googling suggested that perhaps 'export DISPLAY=:0' might help, but it doesn't seem to have any effect, nor does running as sudo or just the plain pi user.

I understand that the es2 pipeline is hardware accelerated and so would like to get that working but it is interesting that the fallback sw pipeline also fails.

Note that I have not installed any X11 dependencies, on the understanding that that openjfx will use the frame-buffer directly and doesn't need X11.

Any advice about how to proceed or do additional diagnostics would be most welcome, thanks!

DePhille
Posts: 2
Joined: Thu Nov 02, 2017 12:13 pm

Re: Error initializing pipeline com.sun.prism.es2.ES2Pipeline on raspberry Pi 4 / Debian Buster

Sun Aug 11, 2019 12:29 pm

Hi,

I would be very interested in a solution for this as I am also having the exact same symptoms.

Return to “Java”