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

Bug 342850

Summary: ClassCastException when bringing up Dynamic Web Project wizard
Product: [WebTools] WTP Java EE Tools Reporter: Chris Jaun <cmjaun>
Component: jst.j2eeAssignee: Israel Gomez Delgado <israelgd>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: ccc
Version: 3.2.3Flags: cbridgha: review+
Target Milestone: 3.2.4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 182823    
Bug Blocks:    
Attachments:
Description Flags
changing the type class of selection object none

Description Chris Jaun CLA 2011-04-14 10:37:57 EDT
1. File > New > Project
2. Typed "dy" to filter down the list.
3. Double clicked on Dynamic Web project.

This error only appears to happen if the wizard has never been opened. Once it opened once I could no longer reproduce. 


java.lang.ClassCastException: org.eclipse.jface.text.TextSelection cannot be cast to org.eclipse.jface.viewers.StructuredSelection
	at org.eclipse.jst.j2ee.internal.wizard.J2EEComponentFacetCreationWizardPage.getSelectedEARName(J2EEComponentFacetCreationWizardPage.java:143)
	at org.eclipse.jst.j2ee.internal.wizard.J2EEComponentFacetCreationWizardPage.restoreEARName(J2EEComponentFacetCreationWizardPage.java:116)
	at org.eclipse.jst.j2ee.internal.wizard.J2EEComponentFacetCreationWizardPage.restoreDefaultSettings(J2EEComponentFacetCreationWizardPage.java:110)
	at org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage.setDefaults(DataModelWizardPage.java:185)
	at org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage.createControl(DataModelWizardPage.java:107)
	at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:170)
	at org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard.createPageControls(ModifyFacetedProjectWizard.java:308)
	at org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard.createPageControls(NewProjectDataModelFacetWizard.java:140)
	at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:734)
	at org.eclipse.jface.wizard.WizardDialog.setWizard(WizardDialog.java:1162)
	at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1221)
	at org.eclipse.jface.wizard.WizardDialog.access$4(WizardDialog.java:1218)
	at org.eclipse.jface.wizard.WizardDialog$6.run(WizardDialog.java:1207)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:1205)
	at org.eclipse.ui.internal.dialogs.NewWizardSelectionPage.advanceToNextPageOrFinish(NewWizardSelectionPage.java:71)
	at org.eclipse.ui.internal.dialogs.NewWizardNewPage$1.doubleClick(NewWizardNewPage.java:354)
	at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:824)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
	at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:822)
	at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1421)
	at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1225)
	at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:238)
	at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:235)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:296)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.ui.actions.NewProjectAction.run(NewProjectAction.java:117)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	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:620)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
Comment 1 Carl Anderson CLA 2011-04-14 10:44:54 EDT
This bug was introduced by the changes made for bug 182823
Comment 2 Israel Gomez Delgado CLA 2011-04-14 10:58:24 EDT
Created attachment 193264 [details]
changing the type class of selection object
Comment 3 Chuck Bridgham CLA 2011-04-14 12:48:18 EDT
approve
Comment 4 Carl Anderson CLA 2011-04-15 11:49:36 EDT
Committed to R3_2_maintenance and HEAD for WTP 3.2.4 and WTP 3.3 M7