I have 2 osgi bundles (say A and B) running in Jboss Fuse. I am using Felix. 'A' bundle exposes a service which 'B' bundle uses. When I deploy both these bundles there is no problem. When I execute osgi:ls -u, I see that bundle 'B' is using service exposed by bundle 'A'
After I restart these 2 bundles together Bundle 'B' cannot find service exposed by Bundle 'A'. At this stage if I execute command osgi:ls, I see OSGI service exposed by bundle 'A'. When I execute osgi:ls -u, I don't see that bundle 'B' is using service exposed by bundle 'A'
I got 2 workaround for this problem
- At this stage if I restart only bundle 'B', then bundle 'B' finds OSGI service exposed by Bundle 'A'. Restarting bundle is not obvious official solution :)
- In bundle 'B', while importing osgi service, if add cardinality as 0:1 then I don't find any issue. But I cant do this as service exposed by bundle 'A' is mandatory for some functionality in bundle 'B'
Can anyone tell me why I am observing this behavior and how I can resolve it ? ?