form-plugin
form-plugin copied to clipboard
org.eclipse.swt.SWTError: No more handles
Hi Hervé, sorry, for this new issue...,
I have defined a view including many technology nodes (near 250) which represents Virtual Machines. I have a form configuration file whith 20 fields. One of the field is a Combo with about 200 values (VM size).
So, the managed data represents near 5000 displayed fields.
After few seconds of form building process, I can't no more use Archi. The form windows still displayed and can't be closed. Icon "Please wait, we are creating the form..." still displayed inside the window.
I have to kill the process Archi.exe.
The error log from Archi is:
!ENTRY org.eclipse.ui 4 0 2019-05-23 14:02:16.006 !MESSAGE Unhandled event loop exception !STACK 0 org.eclipse.swt.SWTError: No more handles at org.eclipse.swt.SWT.error(SWT.java:4559) at org.eclipse.swt.SWT.error(SWT.java:4448) at org.eclipse.swt.SWT.error(SWT.java:4419) at org.eclipse.swt.widgets.Widget.error(Widget.java:482) at org.eclipse.swt.widgets.Control.createHandle(Control.java:718) at org.eclipse.swt.widgets.Control.createWidget(Control.java:758) at org.eclipse.swt.widgets.Scrollable.createWidget(Scrollable.java:151) at org.eclipse.swt.widgets.Control.<init>(Control.java:112) at org.eclipse.swt.widgets.Scrollable.<init>(Scrollable.java:82) at org.eclipse.swt.widgets.List.<init>(List.java:83) at org.eclipse.swt.custom.CCombo.createPopup(CCombo.java:478) at org.eclipse.swt.custom.CCombo.<init>(CCombo.java:158) at org.archicontribs.form.FormJsonParser.getCells(FormJsonParser.java:1443) at org.archicontribs.form.FormJsonParser.createLine(FormJsonParser.java:1047) at org.archicontribs.form.FormJsonParser.createLine(FormJsonParser.java:1064) at org.archicontribs.form.FormJsonParser.createLine(FormJsonParser.java:1064) at org.archicontribs.form.FormJsonParser.createLine(FormJsonParser.java:1064) at org.archicontribs.form.FormDialog.createControl(FormDialog.java:1044) at org.archicontribs.form.FormDialog.<init>(FormDialog.java:306) at org.archicontribs.form.menu.FormEditorHandler.execute(FormEditorHandler.java:60) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:291) at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:92) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55) at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:305) at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:239) at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132) at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152) at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494) at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487) at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210) at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:390) at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:820) at org.eclipse.ui.menus.CommandContributionItem.lambda$3(CommandContributionItem.java:797) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148) at com.archimatetool.editor.Application.start(Application.java:82) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590) at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
Here is the end of plugin log file:
2019-05-23 14:11:10 TRACE 67:FormVariable - getting refered EObject from variable "${property:Comment}" (source object = DiagramModelArchimateObject:"Indus PER BSC FE TBD"(fd0dc4de-1f3e-46c9-a8a2-4402f97d00ee)) 2019-05-23 14:11:10 TRACE 108:FormVariable - --> itself 2019-05-23 14:11:10 DEBUG 1062:FormJsonParser - Indus PER BSC FE TBD is a DiagramModelContainer : getting children 2019-05-23 14:11:21 DEBUG 1642:FormDialog - Cancel button selected by user.
I think I reached some limits (org.eclipse.swt.SWTError: No more handles).
I would like to know if you estimates this is out of plugin usage or if you expect to increase some limits?
I have a work around: split this view in many views with less elements inside, but if I could avoid, it'll be great. This view has a special name which is used by a script to extract properties and node from XML files.
Could you please confirm your operating system ?
If you're on windows, it never happe,d to me ... but if you're on Linux, I remember someone had this error message using Arhi few months (years?) ago. I then can do a search on all my plugins issues and the Archi forum.
On Ubuntu, adding "export SWT_GTK3=0" in archi.sh solves this error message.
I'm using Windows 7. I have added the form configuration file and an archimate file (With txt extention to be able to upload). Both generate the issue.
I tried to change Archi.ini by adding directive --launcher.GTK_version=3, --launcher.GTK_version=0, --launcher.GTK_version=2 but it not solve the issue.
I tried to use Archi in 32 or 64 bits, but same behavior.
strange ... I never heard about this error on Windows ...
what I can suggest:
- remove my plugins to check if one of them is causing the error
- check the version of Java (are you using the one embeded in Archi ?) by checking JAVA_HOME variable
- check if increasing the memory of the jvm solves the issue (-Xmx parameter in the archi.ini file)
You may as well open a case in Archi forum to get help from the whole Archi comunity:(https://forum.archimatetool.com/index.php)
I have open an Archi issue: https://github.com/archimatetool/archi/issues/476
I 'm using the embeded Archi JRE.
I have tested without solving the issue:
- to increase max memorysize in archi.ini to 2GB, 4GB
- use of 32bit or 64 bit version
- remove specialization and modelrepository plugins
@bourboule It could be caused by too many UI elements. It might be worth experimenting with smaller amounts of data to see if this is the cause.
When I do a Google search for "org.eclipse.swt.SWTError: No more handles" it seems to be lack of memory or too many UI elements. For example:
https://developer.ibm.com/answers/questions/378241/what-is-the-cause-of-the-orgeclipseswtswterror-no/
Also worth checking is that all allocated resources are disposed when no longer needed (Image, Font, Color SWT objects)
See https://stackoverflow.com/questions/2018553/swt-no-more-handles
@herve91 Are you creating lots of CCombo objects in a table or tree? This might cause it.
Usually the best practice is to create only one Combo for a table/tree when the cell is being edited (an example is com.archimatetool.editor.propertysections.UserPropertiesSection#KeyEditingSupport
Edit - this may be a symptom and not necessarily the direct cause. Looking at the code for FormJsonParser.java there are a lot of SWT resources created, and perhaps some SWT Images created and not disposed. You may need to refactor the Tree/Table code to use a JFace TreeViewer / TableViewer with associated Content and Label Providers and Cell Editors that are created on demand.
Hi Phil,
That's the reason why I suggested to remove all my plugins to check if one of them is the cause.
Thanks for your link. I'll definitely have a look.
Hi Herve, the stack trace above shows that the Form plug-in is the cause and creating the dialog with many resources is the trigger. ;-)