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

Bug 577927

Summary: Provide better error message in case target schema is not known
Product: [Eclipse Project] PDE Reporter: Lars Vogel <Lars.Vogel>
Component: UIAssignee: Christoph Laeubrich <laeubi>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: laeubi, Lars.Vogel
Version: 4.21   
Target Milestone: 4.23 M1   
Hardware: PC   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=577184
https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/189053
https://git.eclipse.org/c/pde/eclipse.pde.ui.git/commit/?id=d184fe0d16882b06fd7ccb80af6c9cf12755b298
Whiteboard:

Description Lars Vogel CLA 2021-12-21 09:52:58 EST
In one of my runtime workspace I see the following error during shutdown:

e.core.resources 4 2 2021-12-21 15:50:36.715
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 1
org.eclipse.core.runtime.CoreException: Unrecognized target memento scheme
	at org.eclipse.pde.internal.core.target.TargetPlatformService.getTarget(TargetPlatformService.java:175)
	at org.eclipse.pde.internal.core.target.P2TargetUtils.cleanOrphanedTargetDefinitionProfiles(P2TargetUtils.java:239)
	at org.eclipse.pde.internal.core.PDECore$1.saving(PDECore.java:324)
	at org.eclipse.core.internal.resources.SaveManager.executeLifecycle(SaveManager.java:387)
	at org.eclipse.core.internal.resources.SaveManager$1.run(SaveManager.java:204)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.resources.SaveManager.broadcastLifecycle(SaveManager.java:207)
	at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1164)
	at org.eclipse.core.internal.resources.Workspace.save(Workspace.java:2354)
	at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor.lambda$1(IDEWorkbenchAdvisor.java:554)
	at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor$$Lambda$1576/0x0000000000000000.run(Unknown Source)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)


This might be causes by Bug 577184
Comment 1 Christoph Laeubrich CLA 2021-12-21 09:55:49 EST
Can you set a breakpoint and see whats actually causing this?
Comment 3 Christoph Laeubrich CLA 2021-12-21 09:58:09 EST
(In reply to Lars Vogel from comment #2)
> Memento looks like the following
> remote:https://raw.githubusercontent.com/vogellacompany/eclipse4book/testing-
> tycho-http-targetfile/target-platform/target-platform.target

Can you post the linked exception (URISyntaxException) also just for reference?
Comment 4 Christoph Laeubrich CLA 2021-12-21 10:02:20 EST
Are you probably using the same workspace with different eclipse versions?
Comment 5 Lars Vogel CLA 2021-12-21 10:06:53 EST
Sorry, sorry, I tested with the wrong Eclipse installation (2021-12) not an I-build. Using the latest I-build TargetPlatformService understand the remote schema.

Sorry, Christoph for wasting your time.
Comment 6 Eclipse Genie CLA 2021-12-21 10:09:50 EST
New Gerrit change created: https://git.eclipse.org/r/c/pde/eclipse.pde.ui/+/189053
Comment 7 Christoph Laeubrich CLA 2021-12-21 10:10:41 EST
(In reply to Lars Vogel from comment #5)
> Sorry, sorry, I tested with the wrong Eclipse installation (2021-12) not an
> I-build. Using the latest I-build TargetPlatformService understand the
> remote schema.
> 
> Sorry, Christoph for wasting your time.

don't mind, you can review the PR so we get better error output next time :-)
Comment 8 Lars Vogel CLA 2021-12-21 10:55:20 EST
FYI - I now see a NPE and opened Bug 577929 for this.

!MESSAGE java.lang.NullPointerException
!STACK 0
java.lang.NullPointerException
	at java.base/java.util.Arrays.stream(Arrays.java:5645)
	at org.eclipse.pde.internal.core.TargetWeaver.findRunningPlatformBundle(TargetWeaver.java:213)
	at org.eclipse.pde.internal.core.TargetWeaver.isBundleOfRunningPlatform(TargetWeaver.java:195)
	at org.eclipse.pde.internal.core.TargetWeaver.getDevProperty(TargetWeaver.java:191)
	at org.eclipse.pde.internal.core.TargetWeaver.weaveManifest(TargetWeaver.java:114)
	at org.eclipse.pde.internal.core.MinimalState.addBundle(MinimalState.java:201)
	at org.eclipse.pde.internal.core.MinimalState.addBundle(MinimalState.java:195)
	at org.eclipse.pde.internal.core.PDEState.createNewTargetState(PDEState.java:166)
	at org.eclipse.pde.internal.core.PDEState.<init>(PDEState.java:61)
	at org.eclipse.pde.internal.core.PluginModelManager.initializeTable(PluginModelManager.java:602)
	at org.eclipse.pde.internal.core.PluginModelManager.targetReloaded(PluginModelManager.java:522)
	at org.eclipse.pde.internal.ui.wizards.plugin.NewPluginProjectWizard.lambda$0(NewPluginProjectWizard.java:117)
	at org.eclipse.pde.internal.ui.wizards.plugin.NewPluginProjectWizard$$Lambda$899/0x0000000000000000.run(Unknown Source)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:122)
Comment 9 Lars Vogel CLA 2021-12-21 10:55:59 EST
Using this Bug for Christophs improved message.
Comment 11 Lars Vogel CLA 2021-12-22 07:14:16 EST
Thanks, Christoph for the improved error message.