Aboud Zakaria
Aboud Zakaria

Reputation: 567

JCEF with JavaFX fatal error

I'm trying to make JCEF to work in a swingNode in a simple JavaFX Application

public class MainApp extends Application {

    @Override
    public void start(Stage stage) throws Exception {

        SwingNode swingNode = new SwingNode();

        SwingUtilities.invokeAndWait(() -> {
            String startURL = "https://www.google.com/";
            boolean useOSR = OS.isLinux();
            boolean isTransparent = false;

            CefSettings settings = new CefSettings();
            settings.windowless_rendering_enabled = useOSR;

            CefApp cefApp_ = CefApp.getInstance(settings);
            CefClient client_ = cefApp_.createClient();
            CefBrowser browser_ = client_.createBrowser(startURL, useOSR, isTransparent);
            Component browerUI_ = browser_.getUIComponent();

            JPanel panel = new JPanel();
            panel.setSize(800, 600);
            panel.add(browerUI_, BorderLayout.CENTER);

            swingNode.setContent(panel);
        });

        stage.setScene(new Scene(new javafx.scene.Group(swingNode)));
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }

I'm getting a fatal error at client_.createBrowser(startURL, useOSR, isTransparent);

initialize on Thread[AWT-EventQueue-0,6,main] with library path /path/to/jcef/lib/linux64
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f3d07fced50, pid=22843, tid=0x00007f3ca5991700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_111-b14) (build 1.8.0_111-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.111-b14 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [ld-linux-x86-64.so.2+0x9d50]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /path/to/jcef-javafx-maven/hs_err_pid22843.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

however, the provided JCEF awt test examples runs perfectly.

JCEF Version = 3.2840.147
CEF Version = 3.2840.1511
Chromium Version = 54.0.2840.59
Oracle JDK version = 1.8.0_111

edit1: digging into the jcef java code, the fatal error happens at CefBrowserOsr.java line 134

private void createGLCanvas() {
    GLProfile glprofile = GLProfile.getMaxFixedFunc(true); // here

edit2: error log hs_err_pid.log content.

Upvotes: 0

Views: 1755

Answers (1)

Aboud Zakaria
Aboud Zakaria

Reputation: 567

Upgrading to JOGL 2.3.2 and rebuilding JCEF again partially fixes the problem (no jvm crash happens anymore)

however, it seems that the SwingNode would not render a very complicated stuff like a GLCanvas, reference.

Upvotes: 1

Related Questions