Domanda

I do have a service "A" this service will be consumed from 11 other components. If I check all available services via the osgi console I do see only one instance and all 11 components consuming this service.

But for some strange reason, I don't understand, two of the components don't use the same service instance. If I debug I see two different IDs. How can this happen? And I am not doing anything mentioned here.

I solved the problem by setting "This component is immediately activated" within eclipse. But as I red here, this is not the purpose of this checkbox. So maybe someone can explain how this happened in the first place and why it was fixed with this enabled.

È stato utile?

Soluzione

When you use Declarative Services, the DS runtime may under certain circumstances re-instantiate your service, usually because some services it depends on have appeared/changed/got removed and the references are static. Check to see that all sites where service A is used are either static, or dynamic with both bind/unbind methods.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top