Skip to content

Broken on headless Ubuntu 14.04 with Oracle JRE. #87

@shaneargo

Description

@shaneargo

I had a similar issue to #18.

  • Ubuntu 14.04.4 LTS x64
  • Oracle JRE 1.8.0_77-b03 x64

Exception:

Graphics Device initialization failed for :  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:221)
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:205)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:209)
    at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:695)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
    at java.lang.Thread.run(Thread.java:745)
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)
    ... 1 more
[2016-04-11T18:06:29+1000] [WARNING] java.lang.RuntimeException: No toolkit found
    at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:217)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:209)
    at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:695)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
    at java.lang.Thread.run(Thread.java:745)

First thing I did to try and solve it was to install GTK2: sudo apt-get install libgtk2.0-0. Then I got this:

Exception in Application start method
[2016-04-11T18:07:27+1000] [WARNING] java.lang.RuntimeException: Exception in Application start method
    at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.UnsatisfiedLinkError: /usr/lib/jvm/java-8-oracle/jre/lib/amd64/libjfxwebkit.so: libxslt.so.1: cannot open shared object file: No such file or directory
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
    at java.lang.Runtime.load0(Runtime.java:809)
    at java.lang.System.load(System.java:1086)
    at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:201)
    at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:94)
    at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:39)
    at com.sun.webkit.WebPage.lambda$static$39(WebPage.java:130)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.webkit.WebPage.<clinit>(WebPage.java:129)
    at javafx.scene.web.WebEngine.<init>(WebEngine.java:858)
    at javafx.scene.web.WebEngine.<init>(WebEngine.java:845)
    at javafx.scene.web.WebView.<init>(WebView.java:271)
    at com.machinepublishers.jbrowserdriver.App.start(App.java:125)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
    at com.machinepublishers.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:94)
    at com.machinepublishers.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:53)
    ... 1 more

Then I installed webkit2gtk: sudo apt-get install libwebkit2gtk-3.0-25. After this jBrowserDriver started working.

So, I'm not so much reporting a bug, as letting anyone else that may see these exceptions how I managed to fix it. Perhaps it could be said that there is a bug in the README.md insofar as these libs are not listed as prereqs.

Maybe openjfx referenced in the README.md has these dependencies, I dunno. But, this is how I got it working with Oracle.

Please let me know if there is any more information I can provide.

Activity

5hawnknight

5hawnknight commented on Apr 11, 2016

@5hawnknight

its similar to #18

hollingsworthd

hollingsworthd commented on Apr 11, 2016

@hollingsworthd
Owner

Thanks for reporting this. I think installing all of libwebkit2gtk was unnecessary but works because its own dependencies are what's needed. Also see #41 (comment) ... The readme is deficient in this area. I'll look into it.

shaneargo

shaneargo commented on Apr 11, 2016

@shaneargo
Author

@5hawnknight I think it is exactly the same. I referenced it instead of commenting on it because the other was closed.

@hollingsworthd I'm happy to help in any way I can. Perhaps I could purge the libwebkit2gtk-3.0-25 package and then try installing a subset of its dependencies? Just let me know if there is anything you'd like me to do.

hollingsworthd

hollingsworthd commented on Apr 11, 2016

@hollingsworthd
Owner

@shaneargo thanks! But I'm happy to do this... I have a growing collection of test vm's.

omervk

omervk commented on Apr 20, 2016

@omervk

@hollingsworthd Thanks for the great info and the great lib. I'm seeing the following on an EC2 instance running Ubuntu 14.04 and Oracle Java 8 (after installing libgtk2.0-0 as suggested by @shaneargo, though I'm wary about installing libwebkit2gtk after your comment):

[Port 37753; Process 1] Error: JavaFX detected no fonts! Please refer to release notes for proper font configuration
[Port 37753; Process 1] Exception in Application start method
[Port 37753; Process 1] [2016-04-20T13:31:34+0000] [WARNING] java.lang.RuntimeException: Exception in Application start method
[Port 37753; Process 1]     at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
[Port 37753; Process 1]     at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$156(LauncherImpl.java:182)
[Port 37753; Process 1]     at java.lang.Thread.run(Thread.java:745)
[Port 37753; Process 1] Caused by: java.lang.ExceptionInInitializerError
[Port 37753; Process 1]     at javafx.scene.Node.reapplyCss(Node.java:8983)
[Port 37753; Process 1]     at javafx.scene.Node.impl_reapplyCSS(Node.java:8946)
[Port 37753; Process 1]     at javafx.scene.Node.invalidatedScenes(Node.java:854)
[Port 37753; Process 1]     at javafx.scene.Node.setScenes(Node.java:919)
[Port 37753; Process 1]     at javafx.scene.Parent.scenesChanged(Parent.java:659)
[Port 37753; Process 1]     at javafx.scene.Node.invalidatedScenes(Node.java:853)
[Port 37753; Process 1]     at javafx.scene.Node.setScenes(Node.java:919)
[Port 37753; Process 1]     at javafx.scene.Parent.scenesChanged(Parent.java:659)
[Port 37753; Process 1]     at javafx.scene.Node.invalidatedScenes(Node.java:853)
[Port 37753; Process 1]     at javafx.scene.Node.setScenes(Node.java:919)
[Port 37753; Process 1]     at javafx.scene.Scene$9.invalidated(Scene.java:1119)
[Port 37753; Process 1]     at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:111)
[Port 37753; Process 1]     at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:146)
[Port 37753; Process 1]     at javafx.scene.Scene.setRoot(Scene.java:1072)
[Port 37753; Process 1]     at javafx.scene.Scene.<init>(Scene.java:347)
[Port 37753; Process 1]     at javafx.scene.Scene.<init>(Scene.java:223)
[Port 37753; Process 1]     at com.machinepublishers.jbrowserdriver.App.start(App.java:142)
[Port 37753; Process 1]     at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$163(LauncherImpl.java:863)
[Port 37753; Process 1]     at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$176(PlatformImpl.java:326)
[Port 37753; Process 1]     at com.sun.javafx.application.PlatformImpl.lambda$null$174(PlatformImpl.java:295)
[Port 37753; Process 1]     at java.security.AccessController.doPrivileged(Native Method)
[Port 37753; Process 1]     at com.sun.javafx.application.PlatformImpl.lambda$runLater$175(PlatformImpl.java:294)
[Port 37753; Process 1]     at com.machinepublishers.glass.ui.monocle.RunnableProcessor.runLoop(RunnableProcessor.java:94)
[Port 37753; Process 1]     at com.machinepublishers.glass.ui.monocle.RunnableProcessor.run(RunnableProcessor.java:53)
[Port 37753; Process 1]     ... 1 more
[Port 37753; Process 1] Caused by: java.lang.NullPointerException
[Port 37753; Process 1]     at com.sun.javafx.font.LogicalFont.<init>(LogicalFont.java:181)
[Port 37753; Process 1]     at com.sun.javafx.font.LogicalFont.getLogicalFont(LogicalFont.java:113)
[Port 37753; Process 1]     at com.sun.javafx.font.LogicalFont.getLogicalFont(LogicalFont.java:153)
[Port 37753; Process 1]     at com.sun.javafx.font.PrismFontFactory.createFont(PrismFontFactory.java:586)
[Port 37753; Process 1]     at com.sun.javafx.font.PrismFontLoader.loadFont(PrismFontLoader.java:205)
[Port 37753; Process 1]     at javafx.scene.text.Font.<init>(Font.java:319)
[Port 37753; Process 1]     at javafx.scene.text.Font.getDefault(Font.java:86)
[Port 37753; Process 1]     at javafx.scene.CssStyleHelper.<clinit>(CssStyleHelper.java:1528)
[Port 37753; Process 1]     ... 25 more

According to the explanation in Open JFX - Font Setup, I ran fc-list and it returned quite a few fonts. Also ran fc-match sans.regular and it returned a font.

Setting java.awt.headless=true didn't help.

What do you think?

hollingsworthd

hollingsworthd commented on Apr 20, 2016

@hollingsworthd
Owner

@omervk There's nothing wrong with installing libwebkit2gtk. It's just more software than you need. That will probably fix it if you want to get on with it.

Background info... Guessing libfontconfig1 or libfreetype6 specifically is what's missing. Or maybe something related to http://stackoverflow.com/questions/14977546/javafx-nullpointerexception-on-startup ... note I explicitly set the t2k font engine System.setProperty("prism.text", "t2k"); and I think that's not a default setting for the JRE, so this might be a bug Java/Linux maintainers don't normally see (I use t2k because it's more compatible with Windows).

omervk

omervk commented on Apr 20, 2016

@omervk

@hollingsworthd

Both libfontconfig1 and libfreetype6 were already installed on the server.

Reading the link you attached, I found that TTF fonts are required to be on the system. Calling tclist showed no TTF fonts existed on the machine, so I installed fonts-freefont-ttfand everything is now working smoothly!

While continuing to run my tests, I ran into another error: libasound.so.2: cannot open shared object file: No such file or directory, so I also installed libasound2 and this solved the issue.

I'm sure adding these notes to README.MD would be of great help to future users.

Thanks again for your help! :)

hollingsworthd

hollingsworthd commented on Apr 20, 2016

@hollingsworthd
Owner

@omervk thanks for reporting back your findings!

omervk

omervk commented on Apr 24, 2016

@omervk

@hollingsworthd seeing another issue on a different server, none of the steps above help me. The issue is:

[Port 45514; Process 8] Graphics Device initialization failed for :  sw
[Port 45514; Process 8] Error initializing QuantumRenderer: no suitable pipeline found
[Port 45514; Process 8] java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
[Port 45514; Process 8]     at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
[Port 45514; Process 8]     at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:221)
[Port 45514; Process 8]     at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:205)
[Port 45514; Process 8]     at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:209)
[Port 45514; Process 8]     at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)
[Port 45514; Process 8]     at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:695)
[Port 45514; Process 8]     at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
[Port 45514; Process 8]     at java.lang.Thread.run(Thread.java:745)
[Port 45514; Process 8] Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
[Port 45514; Process 8]     at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
[Port 45514; Process 8]     at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
[Port 45514; Process 8]     ... 1 more
[Port 45514; Process 8] [2016-04-24T08:21:47+0000] [WARNING] java.lang.RuntimeException: No toolkit found
[Port 45514; Process 8]     at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:217)
[Port 45514; Process 8]     at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:209)
[Port 45514; Process 8]     at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)
[Port 45514; Process 8]     at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:695)
[Port 45514; Process 8]     at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
[Port 45514; Process 8]     at java.lang.Thread.run(Thread.java:745)

I went to Issue #41's comment and I have all of the packages listed there installed.

I gave up and installed libwebkit2gtk-3.0-25 as per @shaneargo's suggestion and it just worked, so ¯\_(ツ)_/¯

hollingsworthd

hollingsworthd commented on May 11, 2016

@hollingsworthd
Owner

Instructions are now in readme. Thanks for the help here, everyone.

Note that when these Ubuntu bugs are fixed you can use openjdk on Ubuntu 14.04 (16.04 already has it) --
https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1341628
https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1398660

Until then refer to readme instructions. Also note Oracle JRE is based on OpenJDK and from my experience, OpenJDK is usually tested more by package maintainers on Linux and works better.

hollingsworthd

hollingsworthd commented on May 11, 2016

@hollingsworthd
Owner

Also, installing libwebkit2gtk-3.0-25 is a valid approach -- if it's already working for you there's no need to change anything.

omervk

omervk commented on May 11, 2016

@omervk

Thank you :) 👍

thammegowda

thammegowda commented on Jan 29, 2017

@thammegowda

I confirm, sudo apt install openjfx fixed this issue on ubuntu 16.04 with Oracle JDK 1.8

Lotzy

Lotzy commented on Feb 27, 2018

@Lotzy

I confirm too, sudo apt-get install openjfx fixed this issue on Ubuntu 16.04.3 LTS with Oracle JDK 1.8.0_161

added a commit that references this issue on Oct 24, 2018
added a commit that references this issue on Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @omervk@thammegowda@Lotzy@shaneargo@hollingsworthd

        Issue actions

          Broken on headless Ubuntu 14.04 with Oracle JRE. · Issue #87 · hollingsworthd/jBrowserDriver