Bug 200460 - [export] "Eclipse product with AspectJ support" throws ClassCastException on "Finish"
Summary: [export] "Eclipse product with AspectJ support" throws ClassCastException on ...
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: 1.5   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 1.6.0   Edit
Assignee: AJDT-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-19 10:34 EDT by Lubomir Marinov CLA
Modified: 2012-04-03 14:18 EDT (History)
3 users (show)

See Also:


Attachments
Successfully "Finish" exporting "Eclipse product with AspectJ support" (1.12 KB, patch)
2007-08-19 10:34 EDT, Lubomir Marinov CLA
andrew.eisenberg: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lubomir Marinov CLA 2007-08-19 10:34:12 EDT
Created attachment 76381 [details]
Successfully "Finish" exporting "Eclipse product with AspectJ support"

AspectJ Development Tools (AJDT) 1.5.0.200706070619
Eclipse SDK Version: 3.3.0 Build Id: I20070625-1500

Steps to reproduce:

0. Since this bug is reported with AJDT, we'll presume we have Eclipse SDK with AJDT successfully installed.
1. Define a product configuration (mine is based on features) with at least one plug-in requiring AspectJ support.
2. Invoke "File > Export..." from the main menu of Eclipse SDK, select "Plug-in Development > Eclipse product with AspectJ support" in the "Export" dialog and press the "Next >" button.
3. On the "Eclipse product" wizard page, have the product configuration from step 1 selected in the "Configuration" text widget in the "Product Configuration" group. Specify the rest of the required values so that it's legitimate to press the "Finish" button - I provide a value for "Root directory" in the "Product Configuration" group and "Directory" in the "Destination" group.
4. Press the "Finish" button.

What happens:

Nothing seems to happen or change i.e. the "Export" dialog stays as if the "Finish" button hasn't been pressed. The .log of Eclipse SDK reveals the following stack trace:

java.lang.ClassCastException: org.eclipse.pde.internal.ui.wizards.exports.CrossPlatformExportPage cannot be cast to org.eclipse.ajdt.internal.ui.wizards.exports.AbstractExportWizardPage
	at org.eclipse.ajdt.internal.ui.wizards.exports.BaseExportWizard.saveSettings(BaseExportWizard.java:82)
	at org.eclipse.ajdt.internal.ui.wizards.exports.BaseExportWizard.performFinish(BaseExportWizard.java:64)
	at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:742)
	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:373)
	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:616)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
	at org.eclipse.jface.window.Window.open(Window.java:796)
	at org.eclipse.ui.actions.ExportResourcesAction.run(ExportResourcesAction.java:180)
	at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:168)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3682)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3293)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
	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 org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
	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:504)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1169)

What is expected to happen:

The "Export" dialog should close and the export of the product should proceed.

Other information:

I think the cause of the problem is that org.eclipse.ajdt.internal.ui.wizards.exports.BaseExportWizard#saveSettings() expects the wizard pages to be of type org.eclipse.ajdt.internal.ui.wizards.exports.AbstractExportWizardPage while org.eclipse.ajdt.internal.ui.wizards.exports.ProductExportWizard (which extends org.eclipse.ajdt.internal.ui.wizards.exports.BaseExportWizard) adds a org.eclipse.pde.internal.ui.wizards.exports.CrossPlatformExportPage (which is not a org.eclipse.ajdt.internal.ui.wizards.exports.AbstractExportWizardPage) in its #addPages().

I'm attaching a patch that fixes the problem for me (and allows me to successfully export a working product with AspectJ support) to further aid the description of the problem I'm reporting.
Comment 1 Andrew Eisenberg CLA 2008-08-22 15:18:33 EDT
No longer a problem.  Likely this was fixed with the upgrades to using 3.4 exporting features.
Comment 2 Andrew Eisenberg CLA 2008-08-27 14:24:09 EDT
This is not a problem on AJDT 1.5 either.  It is OK to close this bug.
Comment 3 Andrew Clement CLA 2008-08-27 15:21:42 EDT
fixed