eclipse-platform / .github

Common contribution content for eclipse-platform repositories
https://www.eclipse.org/eclipse/
4 stars 10 forks source link

java.lang.IllegalStateException: The bundle belongs to another state: org.eclipse.help_3.10.300.v20240107-2054 #204

Open jukzi opened 1 month ago

jukzi commented 1 month ago

Pressing "Perform Setup Tasks" in a fresh Oomphed platform workspace (https://github.com/eclipse-platform/.github/blob/main/CONTRIBUTING.md) opened an error window:

eclipse.buildId=4.32.0.I20240512-1800
java.version=21.0.2
java.lang.IllegalStateException: The bundle belongs to another state: org.eclipse.help_3.10.300.v20240107-2054
    at org.eclipse.osgi.internal.resolver.StateImpl.basicAddBundle(StateImpl.java:734)
    at org.eclipse.osgi.internal.resolver.StateImpl.addBundle(StateImpl.java:199)
    at org.eclipse.pde.api.tools.internal.model.ApiBaseline.addApiComponents(ApiBaseline.java:370)
    at org.eclipse.pde.api.tools.internal.model.ApiBaseline.restoreFrom(ApiBaseline.java:755)
    at org.eclipse.pde.api.tools.internal.ApiBaselineManager.loadBaselineInfos(ApiBaselineManager.java:247)
    at org.eclipse.pde.api.tools.internal.model.ApiBaseline.loadBaselineInfos(ApiBaseline.java:727)
    at org.eclipse.pde.api.tools.internal.model.ApiBaseline.getApiComponents(ApiBaseline.java:517)
    at org.eclipse.oomph.setup.pde.impl.APIBaselineFromTargetTaskImpl.isNeeded(APIBaselineFromTargetTaskImpl.java:263)
    at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.initNeededSetupTasks(SetupTaskPerformer.java:2285)
    at org.eclipse.oomph.setup.ui.wizards.ConfirmationPage.initNeededSetupTasks(ConfirmationPage.java:357)
    at org.eclipse.oomph.setup.ui.wizards.ConfirmationPage.enterPage(ConfirmationPage.java:261)
    at org.eclipse.oomph.setup.ui.wizards.SetupWizard.pageChanged(SetupWizard.java:658)
    at org.eclipse.jface.wizard.WizardDialog$5.run(WizardDialog.java:1519)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
    at org.eclipse.jface.wizard.WizardDialog.firePageChanged(WizardDialog.java:1516)
    at org.eclipse.jface.wizard.WizardDialog.update(WizardDialog.java:1326)
    at org.eclipse.jface.wizard.WizardDialog.updateForPage(WizardDialog.java:1258)
    at org.eclipse.jface.wizard.WizardDialog.lambda$3(WizardDialog.java:1225)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
    at org.eclipse.jface.wizard.WizardDialog.showPage(WizardDialog.java:1225)
    at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:922)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.eclipse.oomph.util.ReflectUtil.invokeMethod(ReflectUtil.java:119)
    at org.eclipse.oomph.util.ReflectUtil.invokeMethod(ReflectUtil.java:149)
    at org.eclipse.oomph.setup.ui.wizards.SetupWizardPage.gotoPage(SetupWizardPage.java:225)
    at org.eclipse.oomph.setup.ui.wizards.SetupWizardPage.gotoNextPage(SetupWizardPage.java:207)
    at org.eclipse.oomph.setup.ui.wizards.VariablePage$6.run(VariablePage.java:699)
    at org.eclipse.oomph.ui.UIUtil$4.run(UIUtil.java:565)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4058)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3676)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
    at org.eclipse.jface.window.Window.open(Window.java:799)
    at org.eclipse.oomph.setup.ui.wizards.SetupWizard.openDialog(SetupWizard.java:776)
    at org.eclipse.oomph.setup.ui.wizards.SetupWizard$Updater.openDialog(SetupWizard.java:1802)
    at org.eclipse.oomph.setup.ui.wizards.SetupWizard$Updater.perform(SetupWizard.java:1818)
    at org.eclipse.oomph.setup.presentation.handlers.PerformHandler.run(PerformHandler.java:52)
    at org.eclipse.oomph.setup.presentation.handlers.AbstractDropdownItemHandler.execute(AbstractDropdownItemHandler.java:51)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:277)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:98)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:299)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:233)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:174)
    at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:165)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:204)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:444)
    at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:442)
    at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:464)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4285)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1160)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4083)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3673)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1151)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1042)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:152)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:639)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:546)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:173)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:208)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:685)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:622)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1498)

however i could not reproduce the error a second time

merks commented 1 month ago

Goodness knows setting up API tools is not the most reliable thing though I've had fewer problems these past months than previously where I just sometimes had to delete the existing one before I could update to a new one. Perhaps in this case, the IDE was loading the baseline when Oomph tried to "force" it to load:

image

I'm not sure how such a failure could be handled differently by Oomph. A try-catch and hope that nothing that follows goes wrong?

tjwatson commented 1 month ago

Not sure if it is clear or not. The error message indicates that the org.eclipse.osgi.service.resolver.BundleDescription object instance was previously added to another instances of org.eclipse.osgi.internal.resolver.StateImpl. The old resolver API kept state in each BundleDescription such that they could not be shared between multiple instances of StateImpl.