OSGi 捆绑包启动顺序 Linux 与 Windows
我目前正在使用 pax-runner 将许多包部署到 equinox 中。捆绑包位于一个文件夹中,该文件夹的路径通过 args 文件传递给运行程序。我遇到的问题是,相同的捆绑包部署在 Windows 中的启动顺序与在 Linux 中的顺序不同。在 Windows 中,一切都很好,但是在 Linux 中,捆绑包似乎以随机顺序启动。这样做的结果是,某些捆绑包以错误的顺序声明,从而导致错误,例如 jersey-server 在 jersey-core 之前启动,因此我得到了 NPE。谁能解释为什么会发生这种情况?我是否需要指定某些捆绑包的开始顺序?
I am currently deploying a number of bundles into equnox using pax-runner. The bundles are in a folder, the path to this is passed to runner in an args file. The problem I have is that the same deployment of bundles are started in a different order in windows than in linux. In windows everything is fine, however in linux the bundles appear to be started in a random order. The result of this is that some bundles are stated in the wrong order which causes errors, e.g jersey-server gets started before jersey-core so I getr a NPE. Can anyone provide an explanation as to why this happens? Do I need to specify a start order for certain bundles?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们只是扫描目录中的捆绑包,所以我不能说为什么是随机顺序。但可以肯定的是,您不应该依赖该命令。 OSGi 最佳实践表明,您根本不应该依赖启动顺序,但如果您不能不依赖启动顺序,则必须使用不同的方法来指定启动顺序。例如,您可以根据启动顺序将捆绑包放入不同的文件夹中,并指定每个配置目录的启动顺序。
We just scan the directory for bundles so why the random order I cannot say. But for sure you should not rely on that order. OSGi best practices says that you should not rely on start order at all but if you cannot leave without you will have to use different means for specifying the start order. Fo example you could put bundles in different folders per start order to and specify the start order per configured directory.