Backporting OSGI DS component to OSGI R4

不羁的心 提交于 2019-12-11 05:48:31

问题


I have a component which was developed for Apache Karaf 4.0.5. However, it turns out it needs to be deployed on glassfish 4, which is based on an older version of Felix. I get this message when trying to deploy it:

missing requirement [319.0] osgi.extender; (&(osgi.extender=osgi.component)(version>=1.3.0)(!(version>=2.0.0)))

However, my pom file does not show any explicit dependency on osgi.component. I think I must have used some OSGI R5 (or R6?) specific feature, but I don't know which would cause this error.

How can I either convince glassfish to accept my bundle, or change the bundle's build / pom so that I get warnings when trying to use OSGI features dependent on R5 or later?


回答1:


You are probably using a recent version of bnd to generate your bundle and its metadata. Bnd will generate the requirement on the osgi.component extender (This is DS) when your bundle has DS components and either you require something new in DS 1.3 like field injection or you are using the very latest version of bnd.

You can disable the generation of the requirement in your bundle with the bnd instruction:

-dsannotations-options: norequirements



来源:https://stackoverflow.com/questions/40604131/backporting-osgi-ds-component-to-osgi-r4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!