gpt4 book ai didi

java - 使用 intelliJ IDEA 开发 OSGi

转载 作者:行者123 更新时间:2023-12-02 03:22:40 27 4
gpt4 key购买 nike

我正在学习使用intelliJ IDEA开发OSGi应用程序,我选择了Apache的felixApache的felix作为运行时,我遇到的问题如下: the screenshot is here

我开发了模块示例1、2和2b,2b的封装结构与2相同,但服务接口(interface)位于模块2中,模块2b只是为了替代服务而设计的,但我不能成功完成后,felix告诉我模块2b找不到self.gale.services.DictionaryService,我不知道如何使模块2b可以找到确切定义的服务封装在模块2中。

I guess the problem is here

the start method of the Activator in module 2b:

public void start(BundleContext context)
{
Hashtable<String, String> props = new Hashtable<>();
props.put("Language", "French");
context.registerService(
DictionaryService.class.getName(), new DictionaryServiceImpl(), props);
}

the manifest property of module 2b Import-Package: org.osgi.framework,self.gale.services

我的意思是包 self.gale.services 位于模块 2 中,而不是这个 2b,但似乎找不到该包。

最佳答案

您还需要提供在 bundle “2”MANIFEST 文件的导出包中公开的“self.gale.services”,并确保两个 MANIFEST 文件中的“self.gale.services”版本彼此对应。

关于java - 使用 intelliJ IDEA 开发 OSGi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39406555/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com