Equinox 系统捆绑包未导出包

发布于 2024-12-27 01:38:13 字数 1255 浏览 0 评论 0原文

我正在尝试将 Equinox 嵌入到我们当前的服务器端应用程序中。设法以编程方式启动osgi框架。(通过Spring)系统捆绑包被隐式安装并启动(我认为)。但是我注意到没有系统包被导出!

osgi> ss
Framework is launched.
id      State       Bundle
0       STARTING    org.eclipse.osgi_3.7.1.R37x_v20110808-1106

osgi> packages 0
No exported packages

结果,我尝试启动的所有插件都失败了,因为它们都导入包 org.osgi.framework。

有人遇到过这个吗?我缺少一些配置吗?

多谢! 攀登 OSGI 的陡峭学习曲线

我的代码:

private void bootstrapOsgiFmk() {
    logger.info("Starting OSGI framework");
    FrameworkFactory frameworkFactory = ServiceLoader.load(FrameworkFactory.class).iterator().next();
    Map<String, String> config = new HashMap<String, String>();
    config.put("osgi.console", "1234");
    config.put(Constants.FRAMEWORK_STORAGE, "osgilogs/");
    config.put(Constants.FRAMEWORK_STORAGE_CLEAN, "true");
    config.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA,"com.other.pkg");

    Framework framework = frameworkFactory.newFramework(config);
    try {
      framework.start();
    } catch (BundleException e) {
      logger.error("Fail to start osgi framework.", e);
    }
    logger.info("OSGI started");
    context.registerService(IQuoteService.class.getName(), new SimpleQuote(),null);
}

I am trying to embed Equinox into our current server side application. Managed to start the osgi framework programatically.(via Spring) The system bundle gets installed and started implicitly(I think). However I noticed non of the system packages are exported!

osgi> ss
Framework is launched.
id      State       Bundle
0       STARTING    org.eclipse.osgi_3.7.1.R37x_v20110808-1106

osgi> packages 0
No exported packages

As a result all plugins i try to start fails as they all Import package org.osgi.framework.

Anyone come across this? Am I missing some config?

Thanks a lot!
Climbing the Steep learning curve for OSGI

My Code:

private void bootstrapOsgiFmk() {
    logger.info("Starting OSGI framework");
    FrameworkFactory frameworkFactory = ServiceLoader.load(FrameworkFactory.class).iterator().next();
    Map<String, String> config = new HashMap<String, String>();
    config.put("osgi.console", "1234");
    config.put(Constants.FRAMEWORK_STORAGE, "osgilogs/");
    config.put(Constants.FRAMEWORK_STORAGE_CLEAN, "true");
    config.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA,"com.other.pkg");

    Framework framework = frameworkFactory.newFramework(config);
    try {
      framework.start();
    } catch (BundleException e) {
      logger.error("Fail to start osgi framework.", e);
    }
    logger.info("OSGI started");
    context.registerService(IQuoteService.class.getName(), new SimpleQuote(),null);
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文