Issue:
Annotation @reference is disallowed for this location.
Solution:
There are multiple ways to use @Reference annotations in OSGi annotations.
Option 1:
@Reference
MyService myService;
Option 2:
private MyService myService;
@Reference
public void bindMyService(MyService myService) {
this.myService = myService;
}
public void unbindMyService(MyService myService) {
this.myService = myService;
}
To avoid this error use option 2.