English 中文(简体)
OSGi 特殊功能,但包裹仍然安装。
原标题:OSGi feature uninstall works, but bundles are still installed

EDIT: updated this question with latest information...

I m 存在关于附属特性的后向“特性:uninstall”指挥的问题。 秘书长特别代表对“进展中的国家变化”做出回应,但通过接受其他要求,我们遇到了问题。

奇怪的是,这一结果导致成功出现不稳定局面,但失败了。 我们正在解决这一问题,试图妥善地命令不停的要求,在步骤之间增加拖延,但我希望找到更强有力的解决办法。

正如所建议,我还试图在......类似行为之间增加“血清:真实”。 是否有另一种方法可以发现,“旧包”仍在拖延以后的要求等?

详情......

karaf@root> features:uninstall PolicyUtil  
karaf@root> features:uninstall Policy1  
karaf@root> features:uninstall Policy2    
State change in progress for bundle "file:/policy2.jar" by thread "Refresh Packages".  
karaf@root> features:uninstall Policy3  
State change in progress for bundle "file:/policy3.jar" by thread "Refresh Packages".  
karaf@root> features:uninstall Policy4  
karaf@root> features:uninstall Enabler1    
State change in progress for bundle "file:/enabler1.jar" by thread "Refresh Packages".    
karaf@root> features:uninstall Enabler2  
State change in progress for bundle "file:/enabler2.jar" by thread "Refresh Packages".  

afterwards...we end up with features uninstalled (correct), but some bundles still installed (incorrect)

osgi:list

[ 277] [Installed  ] [            ] [       ] [   60] Policy2  
[ 278] [Installed  ] [            ] [       ] [   60] Policy3  
[ 280] [Installed  ] [            ] [       ] [   60] Enabler1  
[ 281] [Installed  ] [            ] [       ] [   60] Enabler2  

features:list

[uninstalled] [1.0                 ] PolicyUtil                           repo-0  
[uninstalled] [1.0                 ] Policy1                              repo-0  
[uninstalled] [1.0                 ] Policy2                              repo-0  
[uninstalled] [1.0                 ] Policy3                              repo-0  
[uninstalled] [1.0                 ] Enabler1                             repo-0  
[uninstalled] [1.0                 ] Enabler2                             repo-0  
最佳回答

坦率地说,我一直对此感到愤慨,我认为我理解这个问题和对策的备选方案。

当执行“姓名:姓名”时,它叫bundle.uninstall(),然后为特征中的每一组别提供复习。 之后,所有包裹都停止使用,所有包裹都要求复习。 问题是复习(每张OSGi spec) ,并将捆包留在解决问题的国家。 随后提出的统一解决特征/障碍的要求未能如期完成。

如果在不设保单之间出现足够的拖延,或者如果后来的停工(在复工之后)完成,则按预期进行重整。

备选办法......

  1. order dependent features/bundles during uninstallation (difficult to control)
  2. put a delay in between uninstall commands (not exact)
  3. verify expected features/bundles are uninstalled (or continue waiting)
  4. listen for FrameworkEvent.PACKAGES_REFRESHED events (complex and not guaranteed because events are container wide, see this example)
  5. modify Karaf/Felix to support an option for synchronously refreshing packages (see this issue/resolution for Karaf 2.1.3)
问题回答

我不敢肯定你会获得何种例外,但你应当知道一件事:当你使用诸如<条码>的单壳指挥系统(http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Bundle.html#uninstall%2829” rel=“noretinger”><条码>Bundle.uninst(all)/<<>>>>/>>。 如你在贾瓦图读的那样,这不是整个故事。

该框架有利于对框架其余部分的影响最小的业务,因此,它可以放弃一个“无<>>>>的“无<>/>”栏,删除所有相关的包裹。 如果你真的想去掉所有这些,你就应当使用osgi:refresh <<<<<><><><>a>。 指挥。 关于这方面的更多信息,见Felix FAQ

我可以提供的最佳建议是,不要发出可以相互交叉的多重<条码>。 如果你想要删除<<<<>>>>>code>uninstall(/a>quest, 之后是

您还可以考虑利用外部管理人安装和清除捆包。 如果你希望进行远程管理,请上。 (公布:Im anache ACE 承诺)。

或......你可以简单地告诉你:

karaf 2.2.x:

osgi:uninstall ————————————

在我的经验中,当一篮子的资源仍然被另一个dle指或使用时,就会出现这种情况。 在这种情况下,该框架无法拆除dle子,而整个杰尔档案仍然由考试和测验局处理。

检查并确保删除所有参考资料。 一个常见的错误也仍在冲锋枪的其中一个物体上。 这也是一种仍在使用的资源,不能去除。

In my case i have uninstalled the feature and noticed the hanging bundle numbers and then shutdown karaf (3.x). Then i have removed the subfolders of folder [karaf-install]/data/cache/[hanging-bundle-number]. Now i restart karaf and the bundle wars not shown in the bundle:list.





相关问题
OSGi - How mature is this technology?

I have a requirement where I need to share some web resources (jsp, html, js, images, css etc.) across different Spring based Struts 2 applications. And seems like OSGi can be used to achieve this? ...

OSGi unit testing without step that packages bundles

I have checked a few testing solution for OSGI including PAX and had a quick look at the abstract TestCase within Spring DM but they both appear to require one to jar up and bundle associated bundles. ...

Is there a way to secure access to bundles in OSGi?

I have an application consisting of several OSGi bundles. I would like to enforce that some of them only provide other bundles access to their services if a valid token (e. g. a license key) has been ...

• 如何限制方案资源+JV/OSGi的权利?

我想建立一个网站,让人们能够解决方案拟定任务,并最终上载解决办法(无论用哪一种证书-语言),以便核实并与其他人分享。

When to use ServiceTracker vs ServiceReference

I am just starting with OSGi programming and have come across two ways to listener for services being activated. The first way, from an EclipseRCP book, uses ServiceReference: String filter="(...

osgi-like framework without the import/export restrictions?

I like OSGi, but the import/export restrictions and the lack of context class loader creates havoc when trying to use 3rd party libraries (e.g., some libraries try to find file.xml in META-INF, ...

热门标签