[英]Why doesn't an OSGi Bundle start even when all the Dependencies are resolved?
1) Problem 1: 1)问题1:
I have come across this scenario quite a few times, finding transitive dependencies converting them to OSGi format and deploying them in OSGi container is already a pain. 我已经多次遇到这种情况,发现将传递依赖项转换为OSGi格式并将其部署到OSGi容器中已经很痛苦。
But sometimes even after doing the above, the bundle does not start WHY ? 但是有时即使完成上述操作后, 捆绑包仍无法启动,为什么?
I double checked the imports, all are satisfied, there are no red marks, but the bundle refuses to go "Active" it always shows "Installed". 我仔细检查了导入内容,所有内容都令人满意,没有红色标记,但是捆绑软件拒绝进入“有效”状态,它始终显示“已安装”。 Why does this happen?
为什么会这样?
2) Problem 2 2)问题2
Another issue I face is NoClassDefError occurring at runtime even when the class is present in Bundle and the bundle is Active. 我面临的另一个问题是,即使类存在于捆绑软件中且捆绑软件处于活动状态,运行时也会发生NoClassDefError 。
An example for this is org.apache.xmlbeans.XmlObject NoClassDefError
org.apache.xmlbeans.XmlObject NoClassDefError
就是一个例子。
If it is missing then it should show it in "red" as missing dependency, but instead it shows all dependencies resolved and bundle is Active? 如果缺少它,则应在“红色”中将其显示为缺少的依赖项,而是显示所有已解决的依赖项,并且捆绑包是否有效? I extracted the contents of the bundle as well to see if it is really there, and found out that it exists then why do these weird errors occur?
我还提取了捆绑软件的内容,以查看它是否确实存在,然后发现它存在,那么为什么会发生这些奇怪的错误呢?
Note: My working environment is Adobe CQ5. 注意:我的工作环境是Adobe CQ5。
A likely cause for bundles not starting is their activators throwing exceptions. 捆绑包无法启动的可能原因是其激活器引发异常。 Those should be visible in the logs, and if not I would set a breakpoint in the bundle Activator to see what's happening.
这些应该在日志中可见,如果没有,我将在捆绑软件Activator中设置一个断点以查看发生了什么。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.