javaeclipseeclipse-plugineclipse-pde

Eclipse plugin trying to load icon from a deleted plugin project


At first I had created the Helloworld plugin using the Eclipse new project wizard. I was able to successfully run it.Then I deleted that project (checked "Delete contents on disk" as well).

After that I created a View contribution using 4.x API plugin project. While running the plugin, the below message was displayed

!MESSAGE Removing PartDescriptorImpl with the "viewplugin.views.SampleView" id and the "Sample View" label.It points to the non available "bundleclass://org.eclipse.ui.workbench/org.eclipse.ui.internal.e4.compatibility.CompatibilityView" class. Bundle might have been uninstalled

But a new eclipse window is opened and when I try to open the view, an exception was thrown and the contents of the view were not displayed.

!ENTRY org.eclipse.core.runtime 4 0 2021-04-02 16:08:38.367
!MESSAGE Invalid input url:platform:/plugin/Helloworld/icons/Sample.png
!STACK 0
java.io.IOException: Unable to resolve plug-in "Helloworld".
    at org.eclipse.core.internal.runtime.PlatformURLPluginConnection.parse(PlatformURLPluginConnection.java:64)
    at org.eclipse.core.internal.runtime.FindSupport.find(FindSupport.java:293)
    at org.eclipse.core.runtime.FileLocator.find(FileLocator.java:206)

and

!MESSAGE The image could not be loaded: URLImageDescriptor(platform:/plugin/Helloworld/icons/Sample.png)
!STACK 0
org.eclipse.jface.resource.DeviceResourceException: Unable to create resource URLImageDescriptor(platform:/plugin/Helloworld/icons/Sample.png)
    at org.eclipse.jface.resource.ImageDescriptor.createResource(ImageDescriptor.java:229)
    at org.eclipse.jface.resource.DeviceResourceManager.allocate(DeviceResourceManager.java:55)
    at org.eclipse.jface.resource.AbstractResourceManager.create(AbstractResourceManager.java:88)

(haven't pasted the full stack trace)

The location mentioned in the stack trace is that of the deleted Helloworld project. Why is eclipse trying to load the icon from a previous project?

I tried restarting the workspace, also tried creating a new workspace. But the error is still generated.

NOTE : I haven't made any changes to the template plugin. Also, there are no issues with hello world template project


Solution

  • By default, the location specified under the workspace data is ${workspace_loc}/../runtime-EclipseApplication. This somehow was causing the previous project to be loaded as well. enter image description here

    I was able to fix this by following these steps:

    1. Click on Workspace option under the "Workspace Data" in the Launch configuration.
    2. Select the appropriate plugin project.
    3. Apply and Run/Debug.