0

I'm fixing up an old Eclipse plugin so that it runs in Neon. I managed to import the dependencies via File->Import... as per https://sourceforge.net/p/e-p-i-c/discussion/258688/thread/7475efd7/#f9cc/cc8a , fixed all the remaining compilation errors and am now ready to try it out.

Yet, when I Debug As... either "Eclipse Application" or "OSGi Framework", it gives me the "The application could not start" error dialog and then, depending on what I select, a couple of stack traces.

But that's of no use. I need to get a debug session so that I can examine the variables and try to deduce what's wrong ('cuz I've no familiarity with common Eclipse plugin stack traces to be able to say what this specific one means just by looking at it).


The setup look good at first glance:

  • The child process starts with the command line "C:\Program Files\Java\jre1.8.0_121\bin\javaw.exe" -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:50467 -Declipse.pde.launch=true -Dfile.encoding=UTF-8 -classpath "C:\Users\Ivan\.p2\pool\plugins\org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar" org.eclipse.equinox.launcher.Main -launcher "C:\Users\Ivan\eclipse\committers-neon\eclipse\eclipse.exe" -name Eclipse -showsplash 600 -product org.eclipse.platform.ide -data "C:\Users\Ivan\workspace-antlr/../runtime-New_configuration" -configuration file:C:/Users/Ivan/workspace-antlr/.metadata/.plugins/org.eclipse.pde.core/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 -nl en_US -consoleLog which seems okay ("New_configuration" launch configuration is of type "Eclipse Application").

  • The "suspend on uncaught exceptions" flag is set.


Stack traces:

In the Console pane:

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)

In the Error Log pane:

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

In .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$5(SetupUIPlugin.java:414)
    at org.eclipse.oomph.setup.ui.SetupUIPlugin$1$1.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

I'm primarily interested in how to get into the debugger. If you just help me with this specific error instead, I'm very likely to get another one right away.

Community
  • 1
  • 1
ivan_pozdeev
  • 33,874
  • 19
  • 107
  • 152

2 Answers2

1

It looks like this might be this Eclipse bug in the Oomph installer code. The bug is marked as fixed and closed but it is not clear which Eclipse release it is in (possibly 4.6.3 due to be released shortly).

A possible workaround may be to use a Target Platform based on one of the simpler Eclipse installs which don't use Oomph. These can be found here.

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • [The patch was applied on 2016-05-16](http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/commit/?id=595cd198ec6874f4babfbb30da59940c5dcb51a0) which is technically before [the first release of Neon (2016-06-06)](http://archive.eclipse.org/eclipse/downloads/index.php). – ivan_pozdeev Mar 19 '17 at 04:52
  • And this still doesn't reveal why the exception isn't caught by the debugger. Isn't it supposed to catch exceptions _anywhere_ in the child process ('cuz it's run with `-agentlib:jdwp`)? Is it because the problem is in the launching Eclipse instance rather than the launched one? Or is the exception actually handled by something and thus the "catch unhandled" flag doesn't apply? – ivan_pozdeev Mar 19 '17 at 04:57
  • Eclipse generally catches all exceptions so that it can log them. – greg-449 Mar 19 '17 at 07:57
  • Was able to get the debug session by trapping `UnsupportedOperationException` specifically (both handled and unhandled). Tracked the problem to `org.eclipse.osgi.storage.FrameworkExtensionInstaller::getExtensionFiles()` - it tries to write to a read-only list when a plugin is being loaded in development mode. – ivan_pozdeev Mar 20 '17 at 02:20
0

Was able to get the debug session by trapping UnsupportedOperationException specifically, both handled and unhandled (this is the exception in the Console pane). Tracked the problem to org.eclipse.osgi.storage.FrameworkExtensionInstaller::getExt‌​ensionFiles() - it tries to write to a read-only list when a plugin is being loaded in development mode.

ivan_pozdeev
  • 33,874
  • 19
  • 107
  • 152