I am currently deploying a numb开发者_高级运维er 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?
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.
精彩评论