Equinox 系统捆绑包未导出包
我正在尝试将 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论