【问题标题】:OSGi doesn't launch selected bundlesOSGi 不启动选定的捆绑包
【发布时间】:2017-04-13 14:24:20
【问题描述】:

当我在运行配置中选择了很少的包启动 OSGi 框架时,Eclipse (Oxygen) 反而会启动所有可用的包并喷出一堆错误。第一个是:

!ENTRY org.eclipse.epp.mpc.ui 4 0 2017-04-13 09:46:50.669
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.epp.mpc.ui [1142]

我在捆绑包列表中总共有 1252 个捆绑包,但 ss 返回 1256 个捆绑包。谁能解释一下为什么会这样?

添加:config.ini

osgi.bundles=reference\:file\:/home/../workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.equinox.simpleconfigurator_1.1.200.v20160504-1450.jar@1\:start
org.eclipse.update.reconcile=false
osgi.bundles.defaultStartLevel=4
osgi.install.area=file\:/home/../workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool
osgi.framework=file\:/home/../workspace/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.osgi_3.11.3.v20170209-1843.jar
org.eclipse.equinox.simpleconfigurator.configUrl=file\:/home/../workspace/.metadata/.plugins/org.eclipse.pde.core/stable-test/org.eclipse.equinox.simpleconfigurator/bundles.info
osgi.configuration.cascaded=false

【问题讨论】:

  • 显示您的 config.ini 文件内容。这将存储在您的配置区域文件夹中。检查运行配置中的配置选项卡。
  • 不要缩短内容,而是编辑您的帖子并添加有问题的全部内容而不是评论。
  • 谢谢@ChandrayyaGK先生!

标签: java eclipse osgi equinox fedora-25


【解决方案1】:

检查插件org.eclipse.epp.mpc.ui是否存在于bungle.info文件中(org.eclipse.equinox.simpleconfigurator.configUrl=file\:/home/../workspace/.metadata/.plugins/org.eclipse.pde.core/stable-test/org.eclipse.equinox.simpleconfigurator/bundles.info)

我认为您的情况缺少它,如果是这样,请在您的 Eclipse 安装中安装此插件。然后在 config.ini 中替换添加 osgi.bundles 属性,如下所述。重新启动应用程序。

osgi.bundles=org.eclipse.epp.mpc.ui@1\:start,reference:file:/home/../workspace/.metadata/.plugins/org.eclipse .pde.core/.bundle_pool/plugins/org.eclipse.equinox.simpleconfigurator_1.1.200.v20160504-1450.jar@1:start`

【讨论】:

  • 那里确实缺少那个插件。从那时起,我使用完全相同的设置创建了一个新的启动配置,效果很好。在工作示例中,插件org.eclipse.epp.mpc.ui 也丢失了。在我切换到该非工作配置并重置为 git 中的相关提交后,我无法再重现该问题,而是得到!MESSAGE FrameworkEvent ERROR !STACK 0 org.osgi.framework.BundleException: Could not resolve module: org.junit [216] Unresolved requirement: Require-Bundle: org.hamcrest.core; bundle-version="1.3.0"; visibility:="reexport"
  • 转到File > Export > Run/Debug > Launch configurations 并选择您的配置,将其保存在您的机器上。导出后,您将在所选目录中获得 .launch 文件,打开此文件并复制内容,然后将其添加到您的问题/帖子中以供进一步分析。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-11-19
  • 1970-01-01
  • 2012-10-10
  • 1970-01-01
  • 2014-02-03
  • 2012-05-25
  • 2015-07-04
相关资源
最近更新 更多