In my test project, it works fine. But now I am trying to integrate JCEF in our main application.
I don't get any errors.
Here is an example code:
- Code: Select all
CefApp xyzApp = CefApp.getInstance(); // works fine
CefClient xyzClient = xyzApp.createClient(); // hangs in this function
The same way it works in my test application (its exact same code).
If I debug through this code I see, that the application "hangs" at:
- Code: Select all
public void start() {
if(!this.isAlive() && super.getState() == State.NEW) {
CefApp.this.lock.lock();
try {
if(SwingUtilities.isEventDispatchThread()) {
CefApp.this.initialize();
}
super.start();
CefApp.this.cefInitialized.awaitUninterruptibly(); // <-- Here it hangs/waits
} finally {
CefApp.this.lock.unlock();
}
}
}
I copied the content of jcef_example_app to ourprojectpath/Contents and passed java.library.path to it:
- Code: Select all
-Djava.library.path="/workspace/xyz-client/Contents/Java/:/workspace/xyz-client/Contents/Frameworks/Chromium Embedded Framework.framework/Libraries"
and tried to add resources-argument like mentioned http://www.magpcss.org/ceforum/viewtopic.php?f=17&t=11884.
CefSettings:
- Code: Select all
CefSettings cefSettings = new CefSettings();
cefSettings.locales_dir_path = "/workspace/xyz-client/Contents/Frameworks/Chromium Embedded Framework.framework/Resources/";
cefSettings.resources_dir_path = "/workspace/xyz-client/Contents/Frameworks/Chromium Embedded Framework.framework/Resources/";
cefSettings.log_severity = CefSettings.LogSeverity.LOGSEVERITY_VERBOSE;
cefSettings.log_file = "/workspace/xyz-client/jcef.log";
CefApp = CefApp.getInstance(cefSettings);
Some hints for me? Is there a way to get some logs of CEF?
Here some output of console while runtime (last few lines):
- Code: Select all
[Dynamic-linking native method sun.nio.fs.UnixNativeDispatcher.init ... JNI]
[Dynamic-linking native method sun.nio.fs.UnixNativeDispatcher.getcwd ... JNI]
Checked JNI functions are being used to validate JNI usage
Checked JNI functions are being used to validate JNI usage
Checked JNI functions are being used to validate JNI usage
initialize on Thread[AWT-EventQueue-0,6,main] with library path /workspace/xyz-client/Contents/Java/
[Dynamic-linking native method org.cef.CefApp.N_Initialize ... JNI]
Edit:
Some information...
MacOsX10.10 with IntelliJ 14 and Java8
(I read about, to set working directory to example jcef app bundle, but its no possibility for me (and I can't test it)
After playing around with it, I got following error:
- Code: Select all
FATAL ERROR in native method: JNI string operation received a non-string
at org.cef.CefApp.N_Initialize(Native Method)
at org.cef.CefApp.access$1100(CefApp.java:25)
at org.cef.CefApp$5.run(CefApp.java:509)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:749)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:702)
at java.awt.EventQueue$3.run(EventQueue.java:696)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:719)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
It crashes in
- Code: Select all
CefApp.this.cefInitialized.awaitUninterruptibly();