问题
I have two bundles - bundle-A exports bnd.a.* packages and bundle-B imports bnd.a.*; I keep these bundles in the deploy folder; it works but there are times when bundle-B comes first before bundle-A and fails! Is there a way to set the start up order for bundles kept in the deploy folder?
Please note that we got it working using feature's start level but not right in the deploy folder.
回答1:
No, as the deploy folder is just another way of deploying bundles during development time. For Production it's always best to use feature descriptors. Another way of using Karaf in development time, use the bundle:watch command from the karaf shell it'll update a bundle in case it did get re-compiled.
Another hint, you should never rely on the start level, instead try to make sure your second bundle imports a service only available when the first bundle is available. This will make sure your application is much more failsafe.
来源:https://stackoverflow.com/questions/31160318/startup-for-bundles-placed-in-the-deploy-folder-of-karaf