I am developing an OSGI-based system which uses declarative services to define components. However, when running it from Eclipse, one of my components is not initialized. When I investigate the issue using simple console commands, I get the following output (with some small obfuscation):
osgi> component 51
Component[
name = com.e.location.view
activate = activate
deactivate = deactivate
modified =
configuration-policy = optional
factory = null
autoenable = true
immediate = false
implementation = com.e.location.view.LocationViewContribution
state = Unsatisfied
properties =
serviceFactory = false
serviceInterface = [com.e.model.ViewContribution]
references = {
Reference[name = SpecificationProvider, interface = com.e.SpecificationProvider, policy = static, cardinality = 1..1, target = null, bind = setSpecificationProvider, unbind = null]
}
located in bundle = com.e.location.view_1.0.0.SNAPSHOT [107]
]
Dynamic information :
The component is satisfied
All component references are satisfied
Component configurations :
Configuration properties:
component.name = com.e.location.view
component.id = 55
objectClass = String[com.e.model.ViewContribution]
Instances:
So the component has state = Unsatisfied
, but the dynamic information states the component is satisfied and its component references are satisfied too.
Can anybody explain this? Why is my component not initialized?
UPDATE: Apparently, setting immedate="true"
for the component fixes the initialization problem. The osgi command still has state = Unsatisfied
though. Anybody know why?
We had similar issues when:
If you are in equinox and did not install a bundle that forwards the LogEvents to the logfile/console, do not forget to check the configuration directory, where equinox puts log files for error messages.