Failed to create CEF browser - Error in simulator

122 views
Skip to first unread message

Angelo Maci

unread,
Aug 4, 2020, 3:58:50 AM8/4/20
to CodenameOne Discussions
If you are experiencing an issue please mention the full platform your issue applies to:
IntelliJ IDEA 2020.2 (Community Edition)
Build #IC-202.6397.94, built on July 27, 2020
Runtime version: 11.0.7+10-b944.20 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.4.0-42-generic
GC: ParNew, ConcurrentMarkSweep
Memory: 949M
Cores: 4
Non-Bundled Plugins: com.codename1.plugin.intellij
Current Desktop: ubuntu:GNOME

CEF has installed.
Trying for the first time to run my app on the simulator I get this error in a dialog: "Exception: java.lang.RuntimeException - Failed to create CEF browser".

And in the log:

Exception: java.lang.RuntimeException - Failed to create CEF browser
java.lang.RuntimeException: Failed to create CEF browser
at com.codename1.impl.javase.cef.JavaCEFSEPort.createCEFBrowserComponent(JavaCEFSEPort.java:106)
at com.codename1.impl.javase.cef.JavaCEFSEPort.createBrowserComponent(JavaCEFSEPort.java:81)
at com.codename1.ui.BrowserComponent$9.run(BrowserComponent.java:531)
at com.codename1.ui.Display.processSerialCalls(Display.java:1331)
at com.codename1.ui.Display.edtLoopImpl(Display.java:1274)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1162)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.lang.reflect.InvocationTargetException
at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1367)
at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1342)
at com.codename1.impl.javase.cef.JavaCEFSEPort.createCEFBrowserComponent(JavaCEFSEPort.java:99)
... 7 more
Caused by: java.lang.UnsatisfiedLinkError: /home/pc/.codenameone/cef/lib/linux64/libjcef.so: libjawt.so: impossibile aprire il file oggetto condiviso: File o directory non esistente
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2640)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
at java.base/java.lang.System.loadLibrary(System.java:1873)
at org.cef.SystemBootstrap$1.loadLibrary(SystemBootstrap.java:24)
at org.cef.SystemBootstrap.loadLibrary(SystemBootstrap.java:36)
at org.cef.CefApp.startup(CefApp.java:536)
at com.codename1.impl.javase.cef.CEFBrowserComponent.create(CEFBrowserComponent.java:178)
at com.codename1.impl.javase.cef.CEFBrowserComponent.create(CEFBrowserComponent.java:170)
at com.codename1.impl.javase.cef.CEFBrowserComponent.create(CEFBrowserComponent.java:167)
at com.codename1.impl.javase.cef.JavaCEFSEPort.createCEFBrowserComponent(JavaCEFSEPort.java:112)
at com.codename1.impl.javase.cef.JavaCEFSEPort$2.run(JavaCEFSEPort.java:102)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
CEF Args: [--disable-gpu, --disable-software-rasterizer, --disable-gpu-compositing, --touch-events=enabled, --enable-media-stream, --device-scale-factor=4, --force-device-scale-factor=4, --autoplay-policy=no-user-gesture-required, --enable-usermedia-screen-capturing]
[EDT] 0:0:2,771 - Exception: java.lang.RuntimeException - Failed to create CEF browser
java.lang.RuntimeException: Failed to create CEF browser
at com.codename1.impl.javase.cef.JavaCEFSEPort.createCEFBrowserComponent(JavaCEFSEPort.java:106)
at com.codename1.impl.javase.cef.JavaCEFSEPort.createBrowserComponent(JavaCEFSEPort.java:81)
at com.codename1.ui.BrowserComponent$9.run(BrowserComponent.java:531)
at com.codename1.ui.Display.processSerialCalls(Display.java:1331)
at com.codename1.ui.Display.edtLoopImpl(Display.java:1274)
at com.codename1.ui.Display.invokeAndBlock(Display.java:1446)
at com.codename1.ui.Display.invokeAndBlock(Display.java:1485)
at com.codename1.ui.Form.showModal(Form.java:2429)
at com.codename1.ui.Dialog.showModal(Dialog.java:1138)
at com.codename1.ui.Dialog.show(Dialog.java:582)
at com.codename1.ui.Dialog.showPackedImpl(Dialog.java:1439)
at com.codename1.ui.Dialog.showPacked(Dialog.java:1355)
at com.codename1.ui.Dialog.showImpl(Dialog.java:1094)
at com.codename1.ui.Dialog.show(Dialog.java:1072)
at com.codename1.ui.Dialog.show(Dialog.java:1027)
at com.codename1.ui.Dialog.show(Dialog.java:793)
at com.codename1.ui.Dialog.show(Dialog.java:746)
at com.codename1.ui.Dialog.show(Dialog.java:711)
at com.codename1.ui.Dialog.show(Dialog.java:652)
at com.codename1.ui.Dialog.show(Dialog.java:807)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1175)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.lang.reflect.InvocationTargetException
at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1367)
at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1342)
at com.codename1.impl.javase.cef.JavaCEFSEPort.createCEFBrowserComponent(JavaCEFSEPort.java:99)
... 22 more
Caused by: java.lang.UnsatisfiedLinkError: /home/pc/.codenameone/cef/lib/linux64/libjcef.so: libjawt.so: impossibile aprire il file oggetto condiviso: File o directory non esistente
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2640)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
at java.base/java.lang.System.loadLibrary(System.java:1873)
at org.cef.SystemBootstrap$1.loadLibrary(SystemBootstrap.java:24)
at org.cef.SystemBootstrap.loadLibrary(SystemBootstrap.java:36)
at org.cef.CefApp.startup(CefApp.java:536)
at com.codename1.impl.javase.cef.CEFBrowserComponent.create(CEFBrowserComponent.java:178)
at com.codename1.impl.javase.cef.CEFBrowserComponent.create(CEFBrowserComponent.java:170)
at com.codename1.impl.javase.cef.CEFBrowserComponent.create(CEFBrowserComponent.java:167)
at com.codename1.impl.javase.cef.JavaCEFSEPort.createCEFBrowserComponent(JavaCEFSEPort.java:112)
at com.codename1.impl.javase.cef.JavaCEFSEPort$2.run(JavaCEFSEPort.java:102)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
java.lang.RuntimeException: Failed to create CEF browser
at com.codename1.impl.javase.cef.JavaCEFSEPort.createCEFBrowserComponent(JavaCEFSEPort.java:106)
at com.codename1.impl.javase.cef.JavaCEFSEPort.createBrowserComponent(JavaCEFSEPort.java:81)
at com.codename1.ui.BrowserComponent$9.run(BrowserComponent.java:531)
at com.codename1.ui.Display.processSerialCalls(Display.java:1331)
at com.codename1.ui.Display.edtLoopImpl(Display.java:1274)
at com.codename1.ui.Display.invokeAndBlock(Display.java:1446)
at com.codename1.ui.Display.invokeAndBlock(Display.java:1485)
at com.codename1.ui.Form.showModal(Form.java:2429)
at com.codename1.ui.Dialog.showModal(Dialog.java:1138)
at com.codename1.ui.Dialog.show(Dialog.java:582)
at com.codename1.ui.Dialog.showPackedImpl(Dialog.java:1439)
at com.codename1.ui.Dialog.showPacked(Dialog.java:1355)
at com.codename1.ui.Dialog.showImpl(Dialog.java:1094)
at com.codename1.ui.Dialog.show(Dialog.java:1072)
at com.codename1.ui.Dialog.show(Dialog.java:1027)
at com.codename1.ui.Dialog.show(Dialog.java:793)
at com.codename1.ui.Dialog.show(Dialog.java:746)
at com.codename1.ui.Dialog.show(Dialog.java:711)
at com.codename1.ui.Dialog.show(Dialog.java:652)
at com.codename1.ui.Dialog.show(Dialog.java:807)
at com.codename1.ui.Display.mainEDTLoop(Display.java:1175)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:120)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.lang.reflect.InvocationTargetException
at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1367)
at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1342)
at com.codename1.impl.javase.cef.JavaCEFSEPort.createCEFBrowserComponent(JavaCEFSEPort.java:99)
... 22 more
Caused by: java.lang.UnsatisfiedLinkError: /home/pc/.codenameone/cef/lib/linux64/libjcef.so: libjawt.so: impossibile aprire il file oggetto condiviso: File o directory non esistente
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2640)
at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
at java.base/java.lang.System.loadLibrary(System.java:1873)
at org.cef.SystemBootstrap$1.loadLibrary(SystemBootstrap.java:24)
at org.cef.SystemBootstrap.loadLibrary(SystemBootstrap.java:36)
at org.cef.CefApp.startup(CefApp.java:536)
at com.codename1.impl.javase.cef.CEFBrowserComponent.create(CEFBrowserComponent.java:178)
at com.codename1.impl.javase.cef.CEFBrowserComponent.create(CEFBrowserComponent.java:170)
at com.codename1.impl.javase.cef.CEFBrowserComponent.create(CEFBrowserComponent.java:167)
at com.codename1.impl.javase.cef.JavaCEFSEPort.createCEFBrowserComponent(JavaCEFSEPort.java:112)
at com.codename1.impl.javase.cef.JavaCEFSEPort$2.run(JavaCEFSEPort.java:102)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Angelo Maci

unread,
Aug 4, 2020, 4:02:19 AM8/4/20
to CodenameOne Discussions
In my app there is a BrowserComponent in the layout, that was displayed in JAVA FX although not properly working.

Steve Hannah

unread,
Aug 4, 2020, 8:25:45 AM8/4/20
to codenameone...@googlegroups.com
It says it can't find libjawt.so, which should be part of your jdk distribution.  I can't seem to reproduce this issue on my system.  Perhaps try adding $JAVA_HOME/lib to your LD_LIBRARY_PATH environment variable.

Searching on Google for "Unsatisfied Link libjawt.so" brings up lots of results with people having this error in different contexts with different libraries on linux, so seems to be a common issue.

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/7920705e-0eea-4d5b-8653-57a91b1a1bffo%40googlegroups.com.


--
Steve Hannah
Software Developer
Codename One

Angelo Maci

unread,
Aug 5, 2020, 5:13:00 AM8/5/20
to CodenameOne Discussions
JAVA_HOME and LD_LIBRARY_PATH are empty on my system. I have IntelliJ Idea and AndroidStudio installed, but I think I did not install standalone java.
What have I to do?

Angelo Maci

unread,
Aug 5, 2020, 5:18:16 AM8/5/20
to CodenameOne Discussions
Instead, I checked, I have
java -version
openjdk version "11.0.8" 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)

but the environment variables are empty as I said.

Steve Hannah

unread,
Aug 5, 2020, 8:00:25 AM8/5/20
to codenameone...@googlegroups.com
Here is a post elaborating on my suggestion about adding to LD_LIBRARY_PATH

You'd probably need to added these to your environment used to launch intelliJ

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discu...@googlegroups.com.

Angelo Maci

unread,
Aug 5, 2020, 2:21:57 PM8/5/20
to CodenameOne Discussions
I run this command
find . | grep "libjawt.so"
and I found that file.
Adding the path to the LD_LIBRARY_PATH environment variable was not helpful, but I copied the file into the
/home/pc/.codenameone/cef/lib/linux64/
directory and now the error is gone.
I see that a BrowserComponent is created although it's has errors in log. I will open a new discussion for that.

To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages