Bug 433525 - "Retrieving archetypes" job change selected archetype in the background
Summary: "Retrieving archetypes" job change selected archetype in the background
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL: https://issues.jboss.org/browse/JBIDE...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-25 10:50 EDT by Fred Bricon CLA
Modified: 2021-04-19 13:23 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 Fred Bricon CLA 2014-04-25 10:50:52 EDT
This bug was initially opened as https://issues.jboss.org/browse/JBIDE-16616
{quote}
STEP: Open Maven Project
STEP: Click on the button Next in New Maven Project dialog (now you are in Select an Archetype page)
ASSERT: Job "Retrieving archetypes:" is running

(This need to be done before the job ends)
STEP: Use filter to get an archetype (e.g. type "org.jboss.portletbridge" or just "portletbridge")
STEP: Select one from the table and click on the button Next
STEP: Fill text fields Group Id and Artifact Id
ASSERT: Button Finish is enabled

STEP: Wait until job ends
ASSERT: Button Finish is still enabled
FAIL: Button Finish is now disabled
{quote}

While trying to reproduce, I saw on one occasion the archetype I selected was literally changed to the simple maven quickstart archetype.
Comment 1 Fred Bricon CLA 2014-04-25 10:55:34 EDT
Additionally, an error occurs if the wizard finsihes before the "retrieving archetypes" job completes :

!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalStateException: Need an underlying widget to be able to set the input.(Has the widget been disposed?))
	at org.eclipse.swt.SWT.error(SWT.java:4441)
	at org.eclipse.swt.SWT.error(SWT.java:4356)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:139)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:832)
	at org.eclipse.jface.window.Window.open(Window.java:808)
	at org.eclipse.jface.dialogs.MessageDialog.open(MessageDialog.java:341)
	at org.eclipse.jface.dialogs.MessageDialog.open(MessageDialog.java:371)
	at org.eclipse.jface.dialogs.MessageDialog.openError(MessageDialog.java:434)
	at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizard$6$1.run(MavenProjectWizard.java:258)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1122)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1006)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:147)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:630)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:574)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:125)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:133)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:103)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:378)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:232)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1462)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Caused by: java.lang.IllegalStateException: Need an underlying widget to be able to set the input.(Has the widget been disposed?)
	at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1704)
	at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardArchetypePage.updateViewer(MavenProjectWizardArchetypePage.java:682)
	at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardArchetypePage$15$3.run(MavenProjectWizardArchetypePage.java:583)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
Comment 3 Igor Fedorenko CLA 2014-04-25 17:02:42 EDT
Curious, why not use getContainer().run(...) to make running operation visible to the user? I think this will also simplify (as in "eliminate") job synchronization logic.
Comment 4 Fred Bricon CLA 2014-04-26 04:34:17 EDT
I honestly didn't even think about it. But you're right, and it provides better feedback. I'll update the fix some time over the week end.
Comment 5 Fred Bricon CLA 2014-04-26 05:46:00 EDT
Actually I don't quite like the result : http://screencast.com/t/WlxXEj5k0heR

all widgets are disabled during process, and given we can't really interrupt a given catalog processing, this is a very unpleasant UX
Comment 6 Fred Bricon CLA 2014-04-29 07:02:24 EDT
Not changing to getContainer().run as it degrades the UX.
Comment 7 Denis Roy CLA 2021-04-19 13:23:14 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/