【问题标题】:Could not resolve module / unresolved requirement org.eclipse.core.runtime无法解析模块/未解决的需求 org.eclipse.core.runtime
【发布时间】:2020-11-03 19:20:39
【问题描述】:

我已将 eclipse 目标平台更新为 eclipse 版本 2020_06 / JDK 11(旧版本:Oxygen 4.7。和 JDK 8)。 'org.eclipse.core.runtime' 作为插件依赖添加到 ch.myorg.myapp.ide.app 的 MANIFEST.MF 中。如果我从 IDE 启动 RCP 应用程序,我会收到以下错误。这里可能是什么问题? 'org.eclipse.core.runtime' 哪里不见了?

java.version=11.0.7
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product ch.myorg.myapp.ide.app.product
Command-line arguments:  -product ch.myorg.myapp.ide.app.product -data C:\projects\workspaces\myappWorkspace -dev file:C:/Projects/Workspaces/Eclipse2020-06-workspace_2/.metadata/.plugins/org.eclipse.pde.core/myorg-ide.product/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog

!ENTRY ch.myorg.myapp.ide.app 2 0
!MESSAGE Could not resolve module: ch.myorg.myapp.ide.app [1]
  Unresolved requirement: Import-Package: ch.myorg.common.util.logging; resolution:="optional"
  Unresolved requirement: Import-Package: ch.myorg.common.util.logging.V2; resolution:="optional"
  Unresolved requirement: Require-Bundle: org.eclipse.core.runtime; bundle-version="3.18.0"


!ENTRY org.eclipse.osgi 4 0 
!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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    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)
An error has occurred. See the log file

config.ini:

#Product Runtime Configuration File

osgi.splashPath=platform:/base/plugins/ch.myorg.myapp.ide.app
eclipse.product=ch.myorg.myapp.ide.app.product
osgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@start,org.eclipse.equinox.ds@start
osgi.bundles.defaultStartLevel=4
org.eclipse.ui.workbench/SHOW_BUILDID_ON_STARTUP=true
usage_reporting_enabled=false
# Tell the BundleLoader to search the classes in the following packages in the system classloader first (before searching the bundles). 
org.osgi.framework.bootdelegation=com.sun.*,sun.*
# osgi.hook.configurators=ch.myorg.myapp.ide.app.hooks.myappDevelopmentHookConfigurator
osgi.framework.extensions=ch.myorg.myapp.ide.app

提前感谢您的回答

【问题讨论】:

  • 日志输出还有更多内容吗?
  • 不,和上面一样
  • 您是否更新了 .product 文件中的插件列表和启动级别以包含版本之间的更改?如果您在 Eclipse 中使用 Run As Eclipse Application 运行,您还需要更新运行配置。
  • 是的,在 .product 文件中,我按下了“添加推荐...”按钮。 org.eclipse.core.runtime 在此处可用,启动级别为“默认”,自动启动为“真”。我还在“运行配置”的“插件”选项卡中按下了“添加所需插件”。如果我按下“验证插件”按钮,则没有检测到问题。 “org.eclipse.core.runtime”也在目标平台部分中列出,其中 Auto-Start 'true' 和 Start-Level 'default'。
  • 可能与osgi.framework.extensions 的使用有关。我的猜测是在解析其他插件之前加载。

标签: java eclipse eclipse-rcp java-11 target-platform


【解决方案1】:

我尝试取消注释 osgi.framework.extensions 并在 config.ini 中更改 org.eclipse.core.runtime 的启动级别,如下所示:

#Product Runtime Configuration File

osgi.splashPath=platform:/base/plugins/ch.myorg.myapp.ide.app
eclipse.product=ch.myorg.myapp.ide.app.product
# osgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@start,org.eclipse.equinox.ds@start
osgi.bundles=org.eclipse.equinox.common@2:start,org.eclipse.update.configurator@3:start,org.eclipse.core.runtime@4:start
osgi.bundles.defaultStartLevel=4
org.eclipse.ui.workbench/SHOW_BUILDID_ON_STARTUP=true
usage_reporting_enabled=false
# Tell the BundleLoader to search the classes in the following packages in the system classloader first (before searching the bundles). 
org.osgi.framework.bootdelegation=com.sun.*,sun.*
# osgi.hook.configurators=ch.myorg.myapp.ide.app.hooks.myappDevelopmentHookConfigurator
# osgi.framework.extensions=ch.myorg.myapp.ide.app

我现在收到以下错误:

!ENTRY org.eclipse.core.runtime 4 0 2020-07-15 14:27:11.405
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.core.runtime [3]
  Unresolved requirement: Require-Bundle: org.eclipse.core.jobs; bundle-version="[3.10.0,4.0.0)"; visibility:="reexport"

    at org.eclipse.osgi.container.Module.start(Module.java:463)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:1845)
    at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:136)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1838)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1781)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1743)
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1665)
    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-07-15 14:27:11.409
!MESSAGE Bundle initial@reference:file:plugins/org.eclipse.core.runtime_3.18.0.v20200506-2143.jar was not resolved.

!ENTRY org.eclipse.core.runtime 2 0 2020-07-15 14:27:11.414
!MESSAGE Could not resolve module: org.eclipse.core.runtime [3]
  Unresolved requirement: Require-Bundle: org.eclipse.core.jobs; bundle-version="[3.10.0,4.0.0)"; visibility:="reexport"


!ENTRY org.eclipse.osgi 4 0 2020-07-15 14:27:11.436
!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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    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)

【讨论】:

    猜你喜欢
    • 2014-08-24
    • 2018-10-08
    • 2016-07-13
    • 2019-06-24
    • 2017-12-19
    • 2021-07-17
    • 2018-04-17
    • 2018-10-01
    • 1970-01-01
    相关资源
    最近更新 更多