Hope this would provide more clues to check the library versions in pom.xml/generated scr:component xmls under OSGI-INF folder --
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
source: Getting Started with OSGi Declarative Services | vogella blog
7.3 @Reference
It is used to specify the dependency on other services. With DS 1.2 it can only be used with Event Methods. DS 1.3 also introduced the usage of @Reference on fields and the type element reference of @Component .
The @Reference annotation needs to be applied on the bind event method. The following defaults are used in that case:
- The name of the bind method is used for the name of the reference. That means the method name after the prefix (e.g. setStringInverter() -> StringInverter). Mind the case sensitivity, as the name in that case starts with an upper case letter.
- 1:1 cardinality.
- Static reluctant policy.
- The requested service is the type of the first argument of the bind method.
It will infer a default unset method and updated method based on the name of the bind method.
Also introduced with DS 1.3 is the Field Strategy for binding services. With this it is not necessary to specify a bind event method for a reference. Instead it is possible to apply the @Reference annotation to a field in the component implementation class. For a static reference the field will be set before the component instance is activated. Dynamic references need to be marked as volatile so that changes to that field are also visible to other threads.
When applying @Reference on a field, the following defaults are used:
- The name of the field is used for the name of the reference.
- 1:1 cardinality if the field is not a collection. 0..n cardinality if the field is a collection.
- Static reluctant policy if the field is not declared volatile. Dynamic reluctant policy if the field is declared volatile.
- The requested service is the type of the field in case the field type is a service type.
Note: Only instance fields are supported. The @Reference annotation can not be applied to static fields.
source: https://blog.osoco.de/2016/05/migrating-from-the-apache-felix-scr-annotations-to-the-osgi-declarative-services-annotatio…
APACHE FELIX SCR ANNOTATION | DESCRIPTION | OSGI DECLARATIVE SERVICES ANNOTATION | DESCRIPTION |
|---|
| @Reference | Reference to services, can be used on unary fields or on class level with bind/unbind methods. | @Reference | Field references can directly be migrated, for event based references (methods), the @Reference annotation must be put on the bind method. In addition, more options for field references exist. |