Community
Participate
Working Groups
When I start an RCP the app fails and the following errors get written in the .log !ENTRY org.eclipse.osgi 4 0 2007-05-21 12:20:35.531 !MESSAGE Application error !STACK 1 org.eclipse.swt.SWTError: No more handles at org.eclipse.swt.SWT.error(SWT.java:3573) at org.eclipse.swt.SWT.error(SWT.java:3465) at org.eclipse.swt.SWT.error(SWT.java:3436) and many more I found out that if I remove the line Platform.endSplash(); the problem stops
C Apostolou: what does the rest of that stack trace look like? Andrew, any ideas? Has the new splash wrapper been tested on 2k?
Without further information we cannot proceed.
(In reply to comment #2) > Without further information we cannot proceed. > ok here you are, sorry about the delay and yes I work on XP !SESSION 2007-05-23 20:45:49.328 ----------------------------------------------- eclipse.buildId=unknown java.version=1.6.0_01 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=el_GR Framework arguments: -product gr.apeirotan.planNET.product Command-line arguments: -product gr.apeirotan.planNET.product -data E:\workspace/../runtime-planNET -dev file:E:/workspace/.metadata/.plugins/org.eclipse.pde.core/planNET/dev.properties -os win32 -ws win32 -arch x86 -clean -debug !ENTRY org.eclipse.osgi 4 0 2007-05-23 20:45:53.578 !MESSAGE Application error !STACK 1 org.eclipse.swt.SWTError: No more handles at org.eclipse.swt.SWT.error(SWT.java:3573) at org.eclipse.swt.SWT.error(SWT.java:3465) at org.eclipse.swt.SWT.error(SWT.java:3436) at org.eclipse.swt.widgets.Widget.error(Widget.java:432) at org.eclipse.swt.widgets.Control.createHandle(Control.java:602) at org.eclipse.swt.widgets.Composite.createHandle(Composite.java:235) at org.eclipse.swt.widgets.Control.createWidget(Control.java:618) at org.eclipse.swt.widgets.Scrollable.createWidget(Scrollable.java:131) at org.eclipse.swt.widgets.Control.<init>(Control.java:97) at org.eclipse.swt.widgets.Scrollable.<init>(Scrollable.java:72) at org.eclipse.swt.widgets.Composite.<init>(Composite.java:93) at org.eclipse.ui.splash.BasicSplashHandler.getBundleProgressMonitor(BasicSplashHandler.java:159) at org.eclipse.ui.splash.BasicSplashHandler.getContent(BasicSplashHandler.java:265) at org.eclipse.ui.internal.splash.EclipseSplashHandler.init(EclipseSplashHandler.java:84) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:595) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37) at org.eclipse.ui.internal.Workbench.createSplashWrapper(Workbench.java:611) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2248) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219) at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at gr.apeirotan.planNET.Application.start(Application.java:142) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:497) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:436) at org.eclipse.equinox.launcher.Main.run(Main.java:1162) at org.eclipse.equinox.launcher.Main.main(Main.java:1137)
And you say removing Platform.endSplash makes this better? End splash is called after the events of this trace... were you calling it yourself?
yes I call it my self and when I call it I get this trace.
When do you call it? Why are you calling it? Is the default behavior not sufficient for your application?
I suspect he is calling Platform.endSplash too early. This ends up calling IApplicationContext.applicationRunning and tearing down the splash screen. The Workbench is not initialized yet and continues to try and place SWT widgets in the splash which no longer exists. DefaultStartupMonitor.applicationRunning does the actual splash tear down If we have anything to do, it is to remove the org.eclipse.equinox.launcher.splash.handle system property when we take down the splash so that the workbench does not try to put anything in it.
*** Bug 196411 has been marked as a duplicate of this bug. ***
Andrew, can we look into the fix you suggested for 3.4 and maybe even 3.3.1?
fix will be trivial
I call Platform.endSplash() on both platform Linux (glibc version 6.x) and Windows, both of them face this problem but window could not run after facing this bug. I call this function because I face problem listing bellow: 1. Run my application. 2. Close the splash when login dialog show. But I could not close the splash. I solve this problem using my way, in this way I get the splash shell and set visible is false, this way run well on Linux but In window It throws StackOverflowException. I show the code to get the splash shell: String splashHandle = System.getProperty("org.eclipse.equinox.launcher.splash.handle"); //$NON-NLS-1$ if (splashShell == null) { // look for the 32 bit internal_new shell method try { Method method = Shell.class .getMethod( "internal_new", new Class[] { Display.class, int.class }); //$NON-NLS-1$ // we're on a 32 bit platform so invoke it with splash // handle as an int splashShell = (Shell) method.invoke(null, new Object[] { display, new Integer(splashHandle) }); } catch (NoSuchMethodException e) { // look for the 64 bit internal_new shell method try { Method method = Shell.class .getMethod( "internal_new", new Class[] { Display.class, long.class }); //$NON-NLS-1$ // we're on a 64 bit platform so invoke it with a long splashShell = (Shell) method.invoke(null, new Object[] { display, new Long(splashHandle) }); } catch (NoSuchMethodException e2) { // cant find either method - don't do anything. } } I don't know why, please show me the way to solved this problem. Note: This bug occur when using Windows XP.
Created attachment 74095 [details] patch
Platform.endSplash() is the preferred way to take down the splash screen. To work around the org.eclipse.swt.SWTError: No more handles problem, remove the splash.handle from the system properties after taking down the splash: System.getProperties().remove("org.eclipse.equinox.launcher.splash.handle") Which will prevent the workbench from trying to do the splash screen later.
Done in HEAD and 3.3.1. Please open a new bug for the StackOverflowException mentioned in comment #11 and attach a stack trace.
*** Bug 197691 has been marked as a duplicate of this bug. ***