JCEF使用JavaFX致命错误
问题描述:
我试图让JCEF在一个swingNode
在client_.createBrowser(startURL, useOSR, isTransparent);
JCEF使用JavaFX致命错误
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
#
工作在一个简单的JavaFX应用程序
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);
}
我得到一个致命的错误。然而,提供的JCEF awt测试示例运行完美。
JCEF Version = 3.2840.147
CEF Version = 3.2840.1511
Chromium Version = 54.0.2840.59
Oracle JDK version = 1.8.0_111
EDIT1:深入挖掘jcef java代码,致命错误发生在CefBrowserOsr.java
线134
private void createGLCanvas() {
GLProfile glprofile = GLProfile.getMaxFixedFunc(true); // here
EDIT2:错误日志hs_err_pid.log
content。
请将您的'hs_err_pid22843.log'文件的内容粘贴到http://pastebin.com并将其链接到您的问题 – specializt
@specializt中,完成。 –
从你的日志判断,你可能偶然发现了一个实际的bug,它似乎是[JOGAMP](https://jogamp.org)提供给你的操作系统的一些classfile的缺失或有缺陷的实现 - 我想你可能会想要在[JOGL-X11](https://jogamp.org/bugzilla/buglist.cgi?component=x11&product=Jogl)上提交错误报告,请确保包含完整的日志文件和可能的源代码,以便它们可以重现它 – specializt