Monday, 29 October 2018

Annotation @reference is disallowed for this location

Annotation @reference is disallowed for this location.

There are multiple ways to use @Reference annotations in OSGi annotations.

Option 1: 
MyService myService;

Option 2:
private MyService myService;
public void bindMyService(MyService myService) {
     this.myService = myService;
public void unbindMyService(MyService myService) {
     this.myService = myService;

To avoid this error use option 2.

1 comment :

  1. I will share it with my other friends as the information is really very useful. Keep sharing your excellent work.Service Apartment for rent in Papanaicken Palayam