【问题标题】:Eclipse plugin trying to load icon from a deleted plugin projectEclipse 插件试图从已删除的插件项目中加载图标
【发布时间】:2021-06-29 05:55:52
【问题描述】:

起初我使用 Eclipse 新项目向导创建了 Helloworld 插件。我能够成功运行它。然后我删除了该项目(也检查了“删除磁盘上的内容”)。

之后,我创建了一个使用 4.x API 插件项目查看贡献。 运行插件时,显示以下消息

!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

但是打开了一个新的 eclipse 窗口,当我尝试打开视图时,抛出异常并且视图的内容没有显示。

!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)

和

!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)

(尚未粘贴完整的堆栈跟踪)

堆栈跟踪中提到的位置是已删除的 Helloworld 项目的位置。为什么 eclipse 会尝试从以前的项目中加载图标?

我尝试重新启动工作区,也尝试创建新工作区。但是仍然会产生错误。

注意:我没有对模板插件进行任何更改。另外,hello world 模板项目也没有问题

【问题讨论】:

  • 尝试使用-clean 选项运行
  • @greg-449 在程序参数中对吗?仍然抛出异常。 URI: bundleclass://Helloworld/com.plugins.helloworld.parts.HelloWorldView
  • 是的,在运行配置程序参数中。我通常有-consoleLog -debug -clean
  • @greg-449,问题在于启动配置中工作区数据的默认位置是${workspace_loc}/../runtime-EclipseApplication

标签: java eclipse eclipse-plugin eclipse-pde


【解决方案1】:

默认情况下,工作区数据下指定的位置是${workspace_loc}/../runtime-EclipseApplication。这不知何故导致之前的项目也被加载。

我可以通过以下步骤解决此问题:

  1. 单击启动配置中“工作区数据”下的Workspace 选项。
  2. 选择合适的插件项目。
  3. 应用和运行/调试。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-04-02
    • 2016-10-05
    • 2013-11-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多