"The application could not start" 当 运行 插件生成堆栈跟踪但不生成调试会话时

"The application could not start" when running a plugin produces a stack trace but not a debug session

我正在修复一个旧的 Eclipse 插件,以便它在 Neon 中运行。我按照 https://sourceforge.net/p/e-p-i-c/discussion/258688/thread/7475efd7/#f9cc/cc8a 设法通过 File->Import... 导入了依赖项,修复了所有剩余的编译错误,现在我准备好尝试一下了。

然而,当我 Debug As... "Eclipse Application" 或 "OSGi Framework" 时,它会给我 "The application could not start" 错误对话框,然后,取决于我 select , 几个堆栈跟踪。

但这没有用。 我需要一个调试会话,以便我可以检查变量并尝试推断出问题所在('因为我不熟悉常见的 Eclipse 插件堆栈跟踪,无法说出什么这个具体的意思就是看一看)。


设置乍一看还不错:


堆栈跟踪:

在控制台窗格中:

java.lang.UnsupportedOperationException
    at java.util.AbstractList.add(Unknown Source)
    at java.util.AbstractList.add(Unknown Source)
    at org.eclipse.osgi.storage.FrameworkExtensionInstaller.getExtensionFiles(FrameworkExtensionInstaller.java:152)
    <...>
    at org.eclipse.osgi.storage.Storage.installExtensions(Storage.java:194)
    at org.eclipse.osgi.storage.Storage.createStorage(Storage.java:92)
    at org.eclipse.osgi.internal.framework.EquinoxContainer.<init>(EquinoxContainer.java:66)
    at org.eclipse.osgi.launch.Equinox.<init>(Equinox.java:31)
    <...>
    at org.eclipse.equinox.launcher.Main.main(Main.java:1492)

在“错误日志”窗格中:

java.lang.NullPointerException
    at org.eclipse.oomph.setup.ui.SetupUIPlugin.performStartup(SetupUIPlugin.java:443)
    at org.eclipse.oomph.setup.ui.SetupUIPlugin.access(SetupUIPlugin.java:414)
    at org.eclipse.oomph.setup.ui.SetupUIPlugin.run(SetupUIPlugin.java:253)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

.log中:

!SESSION 2017-03-14 02:11:24.862 -----------------------------------------------
eclipse.buildId=4.6.2.M20161124-1400
java.version=1.8.0_121
<...>
Command-line arguments:  -product org.eclipse.platform.ide -data C:\Users\Ivan\workspace-antlr/../runtime-New_configuration -dev file:C:/Users/Ivan/workspace-antlr/.metadata/.plugins/org.eclipse.pde.core/New_configuration/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog

!ENTRY org.eclipse.equinox.ds 1 0 2017-03-14 02:11:30.571
!MESSAGE Could not bind a reference of component org.eclipse.ecf.mgmt.rsa.discovery.ui.discovery. The reference is: Reference[name = RemoteServiceAdmin, interface = org.osgi.service.remoteserviceadmin.RemoteServiceAdmin, policy = dynamic, cardinality = 0..1, target = null, bind = bindRemoteServiceAdmin, unbind = unbindRemoteServiceAdmin]

!ENTRY org.eclipse.equinox.ds 1 0 2017-03-14 02:11:30.579
!MESSAGE Could not bind a reference of component org.eclipse.ecf.mgmt.rsa.discovery.ui.discovery. The reference is: Reference[name = IEndpointDescriptionLocator, interface = org.eclipse.ecf.osgi.services.remoteserviceadmin.IEndpointDescriptionLocator, policy = dynamic, cardinality = 0..1, target = null, bind = bindEndpointDescriptionLocator, unbind = unbindEndpointDescriptionLocator]

!ENTRY org.eclipse.egit.ui 2 0 2017-03-14 02:12:17.143
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used <...>: 'C:\Users\Ivan'.

!ENTRY org.eclipse.oomph.setup.ui 2 0 2017-03-14 02:12:19.584
!MESSAGE java.lang.NullPointerException
!STACK 0
java.lang.NullPointerException
    at org.eclipse.oomph.setup.ui.SetupUIPlugin.performStartup(SetupUIPlugin.java:443)
    at org.eclipse.oomph.setup.ui.SetupUIPlugin.access(SetupUIPlugin.java:414)
    at org.eclipse.oomph.setup.ui.SetupUIPlugin.run(SetupUIPlugin.java:253)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

!ENTRY org.eclipse.oomph.setup.ui 1 0 2017-03-14 02:12:22.650
!MESSAGE Setup tasks were performed during startup updating 5 preferences. See 'C:\Users\Ivan\workspace-antlr\.metadata\.plugins\org.eclipse.pde.core\New_configuration\org.eclipse.oomph.setup\setup.log' for details

我主要对如何进入调试器感兴趣。 如果你只是帮我解决这个特定的错误,我很可能会马上得到另一个.

看起来这可能是 this Oomph 安装程序代码中的 Eclipse 错误。该错误被标记为已修复和关闭,但不清楚它在哪个 Eclipse 版本中(可能是即将发布的 4.6.3)。

一种可能的解决方法是使用基于不使用 Oomph 的更简单 Eclipse 安装之一的目标平台。这些可以找到 here

能够通过捕获 UnsupportedOperationException 来获得调试会话,包括已处理和未处理的(这是控制台窗格中的异常)。将问题跟踪到 org.eclipse.osgi.storage.FrameworkExtensionInstaller::getExt‌​ensionFiles() - 当在开发模式下加载插件时,它会尝试写入只读列表。