I have two bundles, one is DB related and another one simple. DB bundle will export osgi service reference. Another one will get the service reference. It is working fine when installing one by one. The service reference is null when starting the Jboss fuse karaf container.
Can i set bundle ordering ? or Can i set delay for completing DB bundle? I need to install bundle after completing DB bundle. Advance Thanks.
The actual code you have to write depends on how your bundles start. Do you use a Java class as BundleActivator? Spring? Blueprint?
Generally speaking, each bundle must specify its dependencies. There are 2 kinds of dependencies:
Your bundle should declare packages and services (Java interfaces) it needs. This way you "force" JBoss/Karaf to start bundles in the correct order and avoid null service references.
Have a look at this guide:
https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html-single/Managing_OSGi_Dependencies/index.html