I am currently developing an application, where I need to initiate multiple JxBrowser. And in the case, when I run my application, with JxBrowser, I try to fully utilitize my CPU usage, 100% and memory consumption on around 85%. Then I start to use a Java Swing UI thread to open one screen at a time. Before the first screen finish initialized, I create another screen, which causes the following error.
com.teamdev.jxbrowser.chromium.BrowserException: Failed to load 'about:blank' web page within 120 seconds.
2017-04-13 15:05:23 257 ->[AWT-EventQueue-0]--[DEBUG]--[System]--com.teamdev.jxbrowser.chromium.BrowserException: Failed to load 'about:blank' web page within 120 seconds.
at com.teamdev.jxbrowser.chromium.Browser.b(Unknown Source)
2017-04-13 15:05:23 258 ->[AWT-EventQueue-0]--[DEBUG]--[System]-- at com.teamdev.jxbrowser.chromium.Browser.b(Unknown Source)
at com.teamdev.jxbrowser.chromium.Browser.<init>(Unknown Source)
2017-04-13 15:05:23 258 ->[AWT-EventQueue-0]--[DEBUG]--[System]-- at com.teamdev.jxbrowser.chromium.Browser.<init>(Unknown Source)
at com.teamdev.jxbrowser.chromium.Browser.<init>(Unknown Source)
2017-04-13 15:05:23 258 ->[AWT-EventQueue-0]--[DEBUG]--[System]-- at com.teamdev.jxbrowser.chromium.Browser.<init>(Unknown Source)
...
What causes the error so problematic is that I am using a GUI thread to create a browser, as a result, my GUI thread is locked for 120 second, then released. And the above error message will be shown.
Currently, I am using a computer, with os = windows 7, i5 cpu, 8gb ram. And JxBrowser = 6.6, and upgrading to 6.13 does not resolve the issue either. Also I am using lightweight, instead of heightweight BrowserType, for integration with JInternalFrame.
In the case, when I am just opening my application normally, with 3 jxBrowser opened one after the other. It works as expected. Does anyone have any idea on what is happening?
I have researched for some time, and see someone saying that there is a deadlock problem when using Mac OS
And I try to add the VM argument, java.ipc.external=true
, but it doesn't help.
Does anyone have any idea, what's going on? Thanks.
I suppose you create several Browser
instances with different BrowserContext
instances configured to use the same Chromium profile directory. Please note that Chromium doesn't allow using the same profile directory in different BrowserContext
instances or processes at the same time. It might lead to different unexpected issues including freezing or even crash in Chromium engine.
In JxBrowser 6.14 we added code that validates profile directory and throw an exception when the directory is already used by another BrowserContext
instance or process. You can try 6.14 version. It will help you to determine root cause of this issue.