gpt4 book ai didi

java - 在 karaf 中安装 scr 功能后,激活方法被调用两次

转载 作者:行者123 更新时间:2023-12-01 10:56:30 25 4
gpt4 key购买 nike

我正在尝试使用 apache-karaf 2.3.10 安装 OSGi bundle ,并使用我已经在此 link 中发布的示例。 。我执行了以下步骤

1. Downloaded apache-karaf version 2.3.10 
2. Executed the command features:install scr. Successfully installed scr. I have verified by executing scr:list
3. Installed all the bundles
4. Finally after starting all the bundles activate method in ExampleComponentFactoryManager called twice and two objects are created. I have verified the same by executing the command scr:list
5. After uninstalling the scr feature the activate method in ExampleComponentFactoryManager called only once which is the expected behaviour.
6. Also i have noted that upto apache-karaf-2.3.10 while installing the scr feature it fetches from the online repo. But from 2.3.11 i am getting error because it tries to fetch it from my maven repository. The error is shown the console.

谁能告诉我 karaf 中的 scr 功能发生了什么?因为通过 scr 功能,我可以看到 karaf 中可用的工厂和实例有哪些。这是预期的吗?

最佳答案

您能否检查一下是否有两个 felix scr 包实例正在运行。这可以解释双对象的创建。

关于java - 在 karaf 中安装 scr 功能后,激活方法被调用两次,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33595375/

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