Bug 2859 - Eclipse abends during New wizard with uncaught Error (1GK1QO1)
Summary: Eclipse abends during New wizard with uncaught Error (1GK1QO1)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P1 normal (vote)
Target Milestone: 2.0 M3   Edit
Assignee: Eduardo Pereira CLA
QA Contact:
URL:
Whiteboard:
Keywords: usability
: 2041 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-10-10 22:44 EDT by Kevin Haaland CLA
Modified: 2005-05-25 18:00 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Haaland CLA 2001-10-10 22:44:50 EDT
During a "New" wizard, if an SWTError is thrown while building a wizard page,
the error is not handled, and the IDE process terminates abnormally (i.e. no proper
shutdown allowing edit sessions to save).  This will cause data loss and perceived
instability in the IDE.

The problem is likely going to happen with any runtime exception, but I've only
seen it with SWTError.  In particular, an SWTError was thrown under Linux when
Combo.setItems(list) was called where list[0] == null.  This doesn't cause an SWTError
in Windows.

To reproduce this, take any New wizard (eg new Java Project). In the 
createControl() method that builds the wizard page content as called by 
Wizard.createPageControls, manually throw an SWTError (throw new SWTError("oops");).  
This is just to simulate an actual SWTError that might be thrown for a variety of 
legitimate reasons such as low system resources.  With that throw in place, run the 
IDE and attempt to create the new object.  When you click Next from the first
wizard page, and it attempts to build the page we modified createControl for,
the IDE will simply shut down.  I expected that the error would be caught, and
the current operation (creating a new Java Project for example) would fail and
info written to .log.

Here is the stack trace that was dumped to stdout in my case:
org.eclipse.swt.SWTError: Item not added
	at org.eclipse.swt.SWT.error(SWT.java:1724)
	at org.eclipse.swt.SWT.error(SWT.java:1741)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:262)
	at org.eclipse.swt.widgets.Combo.setItems(Combo.java:1142)
	at com.ibm.etools.j2ee.common.wizard.NewJ2EEProjectCreationPage.populateEARProjectCombo(NewJ2EEProjectCreationPage.java:148)
	at com.ibm.etools.j2ee.common.wizard.NewJ2EEProjectCreationPage.createControl(NewJ2EEProjectCreationPage.java:54)
	at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:158)
	at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:485)
	at org.eclipse.jface.wizard.WizardDialog.setWizard(WizardDialog.java:835)
	at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:870)
	at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:648)
	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:288)
	at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:236)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:69)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java(Compiled Code))
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:505)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code))
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code))
	at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code))
	at org.eclipse.jface.window.Window.open(Window.java:517)
	at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:63)
	at org.eclipse.ui.internal.NewWizardDropDownAction.run(NewWizardDropDownAction.java:68)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:398)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent(ActionContributionItem.java:352)
	at org.eclipse.jface.action.ActionContributionItem.access$0(ActionContributionItem.java:343)
	at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent(ActionContributionItem.java:47)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java(Compiled Code))
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:505)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java(Compiled Code))
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java(Compiled Code))
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java(Compiled Code))
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:642)
	at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:810)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:280)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:119)
	at org.eclipse.core.launcher.Main.run(Main.java:401)

For additional info, contact Steve Francisco (cisco@ca.ibm.com)

NOTES:

KH (9/20/2001 9:27:41 AM)
	Customer will fix their code. The request is to be more robust when errors happen.
Comment 1 DJ Houghton CLA 2001-10-29 19:21:59 EST
PRODUCT VERSION:
Eclipse build 134 and 135 (likely long before that too)

Comment 2 Kevin Haaland CLA 2002-01-24 20:32:18 EST
This is another case where we can improve stability/servicability. 
Comment 3 Eduardo Pereira CLA 2002-01-31 17:13:42 EST
*** Bug 2041 has been marked as a duplicate of this bug. ***
Comment 4 Eduardo Pereira CLA 2002-01-31 17:15:38 EST
See bug 2041 - Comments: McQ 2002-01-29 10:12.

We are changing it trying to make it more robust and trying to inform the user 
about the problem but it may not be possible do open a dialog. Depending on the 
Error that happened we may not have more handles or memory.
Comment 5 Eduardo Pereira CLA 2002-02-01 18:41:45 EST
Released.
Comment 6 Tom Madison CLA 2005-05-25 18:00:32 EDT
Received the following using version 3.1:

!SESSION 2005-05-25 17:49:10.12 -----------------------------------------------
-
eclipse.buildId=I20050219-1500
java.version=1.5.0_02
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86

!ENTRY org.eclipse.osgi 2005-05-25 17:49:10.12
!MESSAGE Application error
!STACK 1
org.eclipse.swt.SWTError: Item not added
	at org.eclipse.swt.SWT.error(SWT.java:2865)
	at org.eclipse.swt.SWT.error(SWT.java:2762)
	at org.eclipse.swt.SWT.error(SWT.java:2733)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:393)
	at org.eclipse.swt.widgets.Menu.createItem(Menu.java:484)
	at org.eclipse.swt.widgets.MenuItem.<init>(MenuItem.java:118)
	at org.eclipse.jface.action.ActionContributionItem.fill
(ActionContributionItem.java:262)
	at org.eclipse.jface.action.SubContributionItem.fill
(SubContributionItem.java:65)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:625)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:547)
	at org.eclipse.jface.action.MenuManager.fill(MenuManager.java:232)
	at org.eclipse.jface.action.SubContributionItem.fill
(SubContributionItem.java:65)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:625)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:547)
	at org.eclipse.jface.action.MenuManager.fill(MenuManager.java:232)
	at org.eclipse.jface.action.SubContributionItem.fill
(SubContributionItem.java:65)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:625)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:547)
	at org.eclipse.jface.action.MenuManager.fill(MenuManager.java:232)
	at org.eclipse.jface.action.SubContributionItem.fill
(SubContributionItem.java:65)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:625)
	at org.eclipse.jface.action.MenuManager.updateAll(MenuManager.java:719)
	at org.eclipse.ui.internal.WorkbenchWindow.updateActionBars
(WorkbenchWindow.java:2358)
	at org.eclipse.ui.internal.WorkbenchWindow.updateActionSets
(WorkbenchWindow.java:2428)
	at org.eclipse.ui.internal.WorkbenchWindow$4.run
(WorkbenchWindow.java:2248)
	at org.eclipse.swt.custom.BusyIndicator.showWhile
(BusyIndicator.java:69)
	at org.eclipse.ui.internal.WorkbenchWindow.setActivePage
(WorkbenchWindow.java:2221)
	at org.eclipse.ui.internal.WorkbenchWindow.restoreState
(WorkbenchWindow.java:1753)
	at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1453)
	at org.eclipse.ui.internal.Workbench.access$9(Workbench.java:1409)
	at org.eclipse.ui.internal.Workbench$14.run(Workbench.java:1312)
	at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:1015)
	at org.eclipse.core.runtime.Platform.run(Platform.java:757)
	at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1246)
	at org.eclipse.ui.internal.WorkbenchConfigurer.restoreState
(WorkbenchConfigurer.java:171)
	at org.eclipse.ui.application.WorkbenchAdvisor.openWindows
(WorkbenchAdvisor.java:711)
	at org.eclipse.ui.internal.Workbench.init(Workbench.java:918)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1554)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:293)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:144)
	at org.eclipse.ui.internal.ide.IDEApplication.run
(IDEApplication.java:102)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run
(PlatformActivator.java:228)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:333)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:150)
	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.core.launcher.Main.invokeFramework(Main.java:268)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:260)
	at org.eclipse.core.launcher.Main.run(Main.java:887)
	at org.eclipse.core.launcher.Main.main(Main.java:871)