JavaFX program runs through IDE, but not independantly (Ubuntu) - java

I am getting an odd error when I try to run a program that I'm trying to bring to Linux. I am able to compile/run without problems on Windows and OSX, but am seeing this problem on Ubuntu.
When I build/run/debug the program through Netbeans, everything is hunky dorey. It runs, all the tests in its suite complete, etc. When I try to run it independent of the IDE though, I run into the following problems:
Graphics Device initialization failed for : es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:243)
at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at javafx.embed.swing.JFXPanel.lambda$initFx$1(JFXPanel.java:224)
at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
I have been banging my head against this for a few hours, and any thoughts/assistance would be much appreciated.

In my case, this problem occurs when I used oracle JDK and openJFX. When I switched to openJDK problem was solved (only on Ubuntu, Windows does not suffer from this problem).
If this will not help, you can try to change default gtk version for javaFX
-Djdk.gtk.version=2 //you can add as JVM option
The default version of GTK of javaFX was recently changed from gtk2 to gtk3. This fact causes many issues.

Related

Hybris, ant clean all command failes with message Error occurred during initialization of VM

I'm getting this error while trying to build my Hybris project via ant clean all && ./hybrisserver.sh debug:
Error occurred during initialization of VM
java.lang.Error: Could not create SecurityManager
at java.lang.System.initPhase3(java.base#11.0.9.1/System.java:2065)
Caused by: java.lang.ClassNotFoundException: allow
at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base#11.0.9.1/BuiltinClassLoader.java:581)
at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(java.base#11.0.9.1/ClassLoaders.java:178)
at java.lang.ClassLoader.loadClass(java.base#11.0.9.1/ClassLoader.java:522)
at java.lang.Class.forName0(java.base#11.0.9.1/Native Method)
at java.lang.Class.forName(java.base#11.0.9.1/Class.java:398)
at java.lang.System.initPhase3(java.base#11.0.9.1/System.java:2050)
Maybe I put a typo somewhere (see Caused by: java.lang.ClassNotFoundException: allow
) but I can't find anything and my repo's up to date with master which is correctly working, Is there a way to find the problem?
Note: i have Ubuntu 20.04.5 LTS
Thank you
Solution was simple:
Somehow I lost my setantenv.sh configuration, i had to re-run it in /platform

How to debug java.lang.ClassNotFoundException during Tomcat startup?

When Tomcat loads my war, I get this error:
Exception in thread "ClientMessageReceptor0" java.lang.NoClassDefFoundError: java/net/Inet6Address
at org.jacorb.orb.iiop.IIOPAddress.getNetworkInetAddresses(IIOPAddress.java:675)
at org.jacorb.orb.iiop.IIOPAddress.getLocalHost(IIOPAddress.java:591)
at org.jacorb.orb.iiop.IIOPAddress.getLocalHostAddress(IIOPAddress.java:574)
at org.jacorb.orb.listener.SSLListenerUtil.processException(SSLListenerUtil.java:73)
at org.jacorb.orb.iiop.IIOPConnection.handleCommFailure(IIOPConnection.java:77)
at org.jacorb.orb.etf.StreamConnectionBase.read(StreamConnectionBase.java:139)
at org.jacorb.orb.giop.GIOPConnection.getMessage(GIOPConnection.java:389)
at org.jacorb.orb.giop.GIOPConnection.receiveMessagesLoop(GIOPConnection.java:541)
at org.jacorb.orb.giop.GIOPConnection.receiveMessages(GIOPConnection.java:533)
at org.jacorb.orb.giop.MessageReceptor.doWork(MessageReceptor.java:69)
at org.jacorb.util.threadpool.ConsumerTie.run(ConsumerTie.java:60)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: Illegal access: this web application instance has been stopped already. Could not load [java.net.Inet6Address]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1375)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1226)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)
Our application uses Tomcat v9.0.41 and JDK 1.8.0_111 . This same combination works for others in my team and also it worked for me sometime back. I'm not sure what changed now. I have looked at other similar posts and they suggest mismatch between Tomcat and JDK version. But above combination of Tomcat and JDK works for others.
I have removed all other JDK and JRE version on my system.
Ensured JAVA_HOME points to JDK 1.8.0_111 and PATH points to correct JRE.
Any pointers on how to debug this further? Can I turn on some logging during Tomcat startup to see what paths are being used by Tomcat? Any suggestions are highly appreciated :).

Run JavaFX with Visual Studio Code Remote Extension

I'm already trying for a few hours to run a JavaFX application with the help of the Visual Studio Remote Development extension within a Docker Container.
I want to forward the graphic of the application with the help of X11. I already integrated the required packages for X11 in the container, set the DISPLAY environment variable and mounted the X11 socket in the container (/tmp/.X11-unix/).
Unfortunately, it won't work like that... Whenever I try to run the application, I get the following error message:
root#c0699153fc1c:/workspaces/JavaFX/src# java --module-path /usr/share/openjfx/lib/ --add-modules javafx.controls,javafx.fxml HelloWorldApplication.java
Graphics Device initialization failed for : es2, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:222)
at javafx.graphics/com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:260)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:267)
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.launchApplication1(LauncherImpl.java:678)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
... 1 more
Exception in thread "main" java.lang.RuntimeException: No toolkit found
I'm using openjdk:11 as base image for the docker container and installed the following packages inside of it:
openjfx
libx11-dev
libxext-dev
libxrender-dev
libxtst-dev
I previously already tried to run IntelliJ within a Docker container, which is working fine. The GUI gets forwarded to my Display and also JavaFX applications are working fine in there.
I would appreciate any help on this matter. Maybe I oversee something.
EDIT:
I think I found the problem. It seems like OpenJDK:11 and OpenJFX do not work correctly, even though I followed tons of tutorials...
So what I did now is that I exported the JDK, which comes with IntelliJ IDEA and mounted it into the container, which gets created of VS Code. After compiling the .java file with the mounted compiler and executing it, it worked flawlessly.
So now my only problem is, that I need a working setup within VS Code to get JavaFX applications working -> so a proper OpenJDK and OpenJFX configuration.
Finally, I was able to fix the problem. So the solution was:
I created an own Dockerfile, where I took the openjdk:12 image as base and copied the JavaFX libraries (which I got from here: https://gluonhq.com/products/javafx/) into the container. Additionally, I added all required packages for X11 (mentioned above).
In VS Code, after the container has been started, I simply had to add the libs to the "Referenced Libraries".
Afterwards, I had to adjust the launch.json and added the following vmArgs:
"vmArgs": "--module-path <Path-to-FX-Folder> --add-modules javafx.controls"
Now when I run the application, the window is going to be created and shown on my DISPLAY.

Jenkins Pipeline error when building

We have been trying to get Pipeline working on Jenkins 2.107 however it keeps coming up with an error that i have struggled to locate online. We have a Windows 2008 R2 server with Jenkins running as a service.
I have installed the pipeline plugin and set up the Hello World provided to test it. As soon s it starts to build it throws this error to the console.
Running in Durability level: MAX_SURVIVABILITY [BFA] Scanning build
for known causes... [BFA] No failure causes found [BFA] Done. 0s
java.lang.ClassNotFoundException:
org.kohsuke.groovy.sandbox.GroovyInterceptor at
jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1374)
at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1327)
at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1080)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) Caused:
java.lang.NoClassDefFoundError:
org/kohsuke/groovy/sandbox/GroovyInterceptor at
org.jenkinsci.plugins.workflow.cps.CpsGroovyShellFactory.makeClassLoader(CpsGroovyShellFactory.java:113)
at
org.jenkinsci.plugins.workflow.cps.CpsGroovyShellFactory.build(CpsGroovyShellFactory.java:119)
at
org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:556)
at
org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:520)
at
org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:319)
at
hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429) Finished: FAILURE
We are running Java 8 and i have set Jenkins to use Java 8 in the config file. I have researched this error but can't seem to find something similar.
We have another server which runs pipeline fine however the differences are that this is windows 2012 server and it is running an older version of Jenkins and Java. Other than the two differences all plugins and config match.
I had this error and resolved it by upgrading the Script Security plugin to version 1.44 (had 1.41).

java.lang.ClassNotFoundException: apple.laf.AquaTableUI

I use ScrumWorks Pro on my Mac OS X,but an error occurred and the main error message is:
java.lang.ClassNotFoundException: apple.laf.AquaTableUI
I installed the oracle JDK8 and java version is 1.8.0_111.
I searched for a long time and hardly had this solution.But I found AquaTableUI class in openjdk8.
I want to know if apple.laf.AquaTableUI is only available in openjdk,but not in Oracle.If not, is there a solution?
Looking forward to your answer,Thanks.

Categories

Resources