Swt Browser No More Handles Error

swt browser No more handles Error

It's not about system handles (directly), it's about firefox installation.

Check the SWT FAQ - What do I need to run the SWT Browser inside Eclipse on Linux and SWT Bug 103611 - internet cache didn't work on Linux and especially IBM Support - SWTError: No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)].

EDIT

For the seconds error message check Eclipse Community Forums - Could not detect registered XULRunner to use and also check if you have correct XULRunner version installed at SWT FAQ - What do I need to run the SWT Browser inside Eclipse on Linux?.

SWT: No more Control handles

You may well have reached the limit. Note that the number of handles varies a lot between platforms (macOS, Linux, Windows) so if you plan to run this on different platforms you need to test on all of them.

If you are using SWT classes derived from Resource (Color, Font, Image, Cursor, ....) then you must call dispose on the object when you are done with it. Failing to do so will leak handles.

You should also try to share these resources - for example don't create a new Color each time. Use a manager class that handles sharing the colors, the manager class can also handle disposing of the resources.

JFace provides manager classes such as ColorRegistry, FontRegistry and ImageRegistry which might be useful.

If this is not enough you will have reduce this large number of controls, perhaps you could use pop-up dialogs to show some of the information when buttons are pressed.

Eclipse: The SWT browser widget could not be created

From the error message and from some further research it is clear, that the SWT browser widget relies on the XULRunner software to render HTML. As the error message states, this hasn't been ported to GTK3 (yet) and can thus not be used. Per default eclipse does start in GTK3-mode though, so that's the root problem.

An attempt to solve it could be to force eclipse into GTK2-mode (see here) but further investigation of the Eclipse FAQ shows, that from Eclipse 4.8 and onward XULRunner isn't supported at all anymore.

Therefore the option to use the SWT.MOZILLA style for creating the browser seems to be invalid in those versions. Instead one has to focus on getting the SWT.WEBKIT style to work. For that another visit in the FAQ reveals that

WebKitGTK 1.2.0 or newer must be in the library load path.

Therefore I went ahead and searched for the respective library and installed it (libwebkitgtk-3.0-0 in my case).

After having installed that package above SWT-snipped started just fine and after having restarted eclipse, the JavaDoc was back to full functionality.

If this doesn't work for you directly, you might have to set the org.eclipse.swt.browser.DefaultType variable accordingly. According to this question, this can be done by ensuring that -Dorg.eclipse.swt.browser.DefaultType=webkit is in the eclipse.ini file.

XULRunner error in Eclipse / SWT

Ok, so I managed to get XULRunner working in the following way:

1) Download XULrunner 24.0. You can find the versions I used here:

  • 64-bit: https://osdn.net/projects/sfnet_runawfe/downloads/SRC%20and%20BIN%20files/extras/xulrunner-1.9.2.25-win64.zip/

  • 32-bit: http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/24.0b10/runtimes/xulrunner-24.0b10.en-US.win32.zip

2) In my Java code I create a Composite to contain my Browser object.

In its constructor I set the path to the xulrunner folder I downloaded in step 1, and then instantiate the browser:

public class MyBrowserComp extends Composite {

private String pathToXulrunner = "C:\\path\\to\\xulrunner";`

private Browser browser;

public MyBrowserComp(..) {
System.setProperty("org.eclipse.swt.browser.XULRunnerPath", pathToXulrunner);
browser = new Browser(this, SWT.MOZILLA);
}
}

Eclipse Unhandled event loop exception No more handles in windows 7

I think that this problem has been resolved by updating windows 7 to the latest Windows Update. The last two days I haven't faced this problem again. I hope it does not appear in the future.

Trouble with Browser type SWT.MOZILLA on windows 8 64 bit

Ok, loading XURLRunner 10.0.2 works. The crashing app was due to a stack overflow error in my js code.



Related Topics



Leave a reply



Submit