How to troubleshoot dependency problem with OSGi libraries when doing a PDE build?

心不动则不痛 提交于 2020-04-30 09:25:11

问题


I'm trying to build a feature product using the latest Eclipse 2020-03 (4.15.0) version and hitting the error Unresolved requirement below. I have this same exact issue with Eclipse 2019-12 (4.14.0).

This issue does not occur if using Eclipse Mars (4.5.2).

eclipse.buildId=4.15.0.I20200305-0155
java.version=1.8.0_252
java.vendor=Amazon.com Inc.
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -application org.eclipse.ant.core.antRunner -verbose -buildfile c:\Users\zoomzoom\.p2\pool\plugins\org.eclipse.pde.build_3.10.700.v20191228-1214\scripts\productBuild\productBuild.xml
Command-line arguments:  -application org.eclipse.ant.core.antRunner -verbose -debug -buildfile c:\Users\zoomzoom\.p2\pool\plugins\org.eclipse.pde.build_3.10.700.v20191228-1214\scripts\productBuild\productBuild.xml

!ENTRY org.eclipse.core.runtime 4 0 2020-04-25 23:47:13.617
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.core.runtime [6]
  Unresolved requirement: Require-Bundle: org.eclipse.equinox.common; bundle-version="[3.10.0,4.0.0)"; visibility:="reexport"

    at org.eclipse.osgi.container.Module.start(Module.java:462)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1844)
    at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1837)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1780)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1742)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1664)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)

!ENTRY org.eclipse.osgi 4 0 2020-04-25 23:47:13.625
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.core.runtime_3.17.100.v20200203-0917.jar was not resolved.

!ENTRY org.eclipse.core.runtime 2 0 2020-04-25 23:47:13.631
!MESSAGE Could not resolve module: org.eclipse.core.runtime [6]
  Unresolved requirement: Require-Bundle: org.eclipse.equinox.common; bundle-version="[3.10.0,4.0.0)"; visibility:="reexport"


!ENTRY org.eclipse.osgi 4 0 2020-04-25 23:47:13.632
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:81)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:657)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:594)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1420)

I have tried the following:

  1. I've ensured only org.eclipse.equinox.common version 3.11 jar file exists on the box. I've put the 3.11 jar files in the same locations of the org.eclipse.core.runtime jar file: C:\Users\zoomzoom.p2\pool\plugins\ and C:\eclipse\eclipse4_15_0\eclipse\plugins

  2. I've ensured the start levels on the configuration tab of my .product file are not set, per this answer for a question about a similar error.

  3. I've ensured the permissions on C:\Users\zoomzoom.p2 is completely open to all users.

How do I troubleshoot this further? Are there utilities that can help me figure out where it's looking for the required libraries?

Edit: Here's a screenshot of the .product file. I've tried both with the recommended start-levels as seen in the screenshot, and with them cleared out. With Eclipse 4.5.2, it built successfully with no start-levels specified, the list was empty.

来源:https://stackoverflow.com/questions/61459907/how-to-troubleshoot-dependency-problem-with-osgi-libraries-when-doing-a-pde-buil

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!