What Could Be Reason for "Prism-Es2 Error:Gl_Version (Major.Minor) = 1.4"

What could be reason for Prism-ES2 Error : GL_VERSION (major.minor) = 1.4 ?

Which version of JavaFX are you using? Please, note FX2.x is not supported on RedHat/OEL. But FX8 is, you may want to try dev releases of FX8: https://jdk8.java.net/download.html

Regarding FX8:

Prism-ES2 Error : GL_VERSION (major.minor) = 1.4 message is not an error but notification message. It will be removed in jdk8 release: https://javafx-jira.kenai.com/browse/RT-29273

GThread-ERROR from samples is another story. It's an issue which may be not yet fixed. See https://javafx-jira.kenai.com/browse/RT-32436 and https://javafx-jira.kenai.com/browse/RT-28580#comment-358413

What do d3d, es2, j2d, null3d, and sw in the javafx prism package represent?

Those packages represent implementations of different graphics-pipelines

  • d3d is short for Direct3D, part of DirectX
  • es2 is for OpenGL ES2.0
  • j2d represents the Java 2D API
  • null3d - not sure but probably a dummy-implementation for development/testing
  • sw - software pipeline

JavaFX Media Exception. Could not create player

Sorted this out by installing Java 9.0.4 and Intellij IDE. Netbeans 8.2 isn't compatible with java 9. The code was all right.

UPDATED CODE

The controller source has been updated to make it compatible with java9. For some reason java.nio.file.Paths; isn't working with the latest java.

Getting a javaFX 11 app to work on docker

I finally got this to work! I had to install VcXsrv on my Windows host and add this to the docker run command :

-e DISPLAY=MY IP ADDRESS:0.0

My app now starts fine and outputs the following before actually starting the Spring initialization :

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
MESA-LOADER: failed to open swrast (search paths /usr/lib/xorg/modules/dri)
libGL error: failed to load driver: swrast
Prism-ES2 Error : GL_VERSION (major.minor) = 1.4
(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
MESA-LOADER: failed to open swrast (search paths /usr/lib/xorg/modules/dri)
libGL error: failed to load driver: swrast
vsync: true vpipe: false

There are still some errors that i will try and work through but it actually starts now!

Full dockerfile as requested, I am still working through the errors that are causing it to fallback to the prism pipeline, will update later :

FROM adoptopenjdk/openjdk11:alpine
VOLUME /tmp
RUN apk update && apk add libx11 mesa-gl gtk+3.0 mesa-dri-swrast mesa-demos
&& apk update
ADD someJar.jar someJar.jar
ADD lib lib
ADD config.properties config.properties
ENTRYPOINT ["java", "-javaagent:lib/aspectjweaver-1.9.2.jar", "-javaagent:lib/spring-instrument-5.1.6.RELEASE.jar", "--module-path", "lib", "--add-modules=javafx.controls", "-Dprism.verbose=true", "-Djava.awt.headless=true", "-jar","someJar.jar"]

******FINAL SETUP******

I dug into the libGL errors and the hassle of getting the ES2 pipeline to work is not even worth it for my needs. It would involve messing with Nvidia and CUDA drivers and is totally useless since my app is just a background service anyway. Here is the final setup to make everything work :

Dockerfile (switched back to openjdk for consistency with my other app and figured out the bare minimum packages to install)

FROM openjdk:11-jre-slim
RUN apt-get update && apt-get install libgtk-3-0 libglu1-mesa -y && apt-get update
VOLUME /tmp
ADD someJar.jar someJar.jar
ADD lib lib
ADD config.properties config.properties
ENTRYPOINT ["java", "-javaagent:lib/aspectjweaver-1.9.2.jar", "-javaagent:lib/spring-instrument-5.1.6.RELEASE.jar", "--module-path", "lib/javafx-sdk-11.0.2", "-jar", "someJar.jar"]

Docker build command

docker build -f Dockerfile -t some_service .

Docker run command

docker run -t --name Some_Service -e DISPLAY=MY IP:0.0 -e SOME_VARIABLE= --link mySQLSRV:mysql some_service

Hope this helps someone, this took me days to get working!

Deploy JavaFX on Ubuntu server without display

I don't think JavaFX 2.x supports running in a headless mode. I don't know of any workaround.

For further info see the JavaFX issue tracker feature request: RT-34241 Use of WebEngine in a headless system, currently scheduled for implementation for Java 9.

InternalError running JavaFX 15 application on Windows Subsystem for Linux

Thanks for the comments @José Pereda and @mipa which helped me towards a fix, adding libgtk-3

sudo apt install libgtk-3-0


Related Topics



Leave a reply



Submit