Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 347345

Summary: Sapphire HTML panel fails on default install of Ubuntu 11.04
Product: z_Archived Reporter: Greg Amerson <gregory.amerson>
Component: SapphireAssignee: Konstantin Komissarchik <konstantin>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: konstantin
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:

Description Greg Amerson CLA 2011-05-26 13:00:52 EDT
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)
Comment 1 Greg Amerson CLA 2011-05-26 13:10:14 EDT
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.
Comment 2 Konstantin Komissarchik CLA 2011-06-06 14:56:32 EDT
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.
Comment 3 Greg Amerson CLA 2011-06-07 10:57:57 EDT
Verified on linux with build#382
Comment 4 Konstantin Komissarchik CLA 2011-06-07 11:31:53 EDT
Closing.