Community
Participate
Working Groups
I was testing a Sapphire dialog that has a HTML panel. When I tried to load the dialog it throws SWT exception which fails very ungracefully and prompts the user to shut down the whole workbench. Here is the exception and is followed by "SWT error shut down the workbench" dialog. org.eclipse.swt.SWTError: No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)] at org.eclipse.swt.SWT.error(SWT.java:4109) at org.eclipse.swt.browser.Mozilla.initMozilla(Mozilla.java:1739) at org.eclipse.swt.browser.Mozilla.create(Mozilla.java:656) at org.eclipse.swt.browser.Browser.<init>(Browser.java:119) at org.eclipse.sapphire.ui.SapphireHtmlPanel.render(SapphireHtmlPanel.java:179) at org.eclipse.sapphire.ui.SapphirePartContainer.render(SapphirePartContainer.java:90) at org.eclipse.sapphire.ui.SapphireComposite.render(SapphireComposite.java:175) at org.eclipse.sapphire.ui.SapphirePartContainer.render(SapphirePartContainer.java:90) at org.eclipse.sapphire.ui.SapphireComposite.render(SapphireComposite.java:175) at org.eclipse.sapphire.ui.swt.SapphireDialog.createDialogArea(SapphireDialog.java:91) at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:760) at org.eclipse.sapphire.ui.swt.SapphireDialog.createContents(SapphireDialog.java:106) at org.eclipse.jface.window.Window.create(Window.java:431) at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
I have a lot of personal experience debugging the Mozilla embedded browser component on Linux. It is a nightmare at best. So that is not a problem that Sapphire can solve, we just have to know that the SWT Browser component on Linux fails about 50% of the time. In my test case its a brand new out-of-the box Ubuntu 11.04 (latest one) install. So its a terrible situation. However, I would like to see if Sapphire could try to degrade gracefully. Basically it can do some test ahead of time to check if it is going to completely fail and if so, don't even try to disable the HTML render panel. Perhaps it could fallback to just textarea or just have a label explaining that the particular component is no available. I'm wondering if there is a library out there that will take a HTML dom and extract the plain text, that could be displayed as a graceful fallback.
I implemented the simple approach of showing a static "could not initialize embedded browser" message in place of the browser widget. We can explore more complex solutions in the future, if necessary. Please verify as I do not have ready access to a system to repro this problem on.
Verified on linux with build#382
Closing.