Skip to main content
Level 3
Aug 21, 2018 3:11 PM UTC
Solved

The attribute policyOption is undefined for the annotation type Reference

Hi

can anyone help on this below issue,

We are replacing felix annotations with OSGI DS annotations. We have come across with a challenge please find below

Felix annotation :

  @Reference(policyOption = ReferencePolicyOption.GREEDY)

  protected UserConnector userConnector;

 

OSGI Annotation I tried :

  protected UserConnector userConnector;

 

  @Reference(policyOption = ReferencePolicyOption.GREEDY)

  public void bindUserConnector(UserConnector userConnector) {

    this.userConnector = userConnector;

  }

  public void unbindUserConnector(UserConnector userConnector) {

    this.userConnector = userConnector;

  }

 

But there is an error in eclipse where “The attribute policyOption is undefined for the annotation type Reference”.

Can you please tell me whether policyOption is deprecated in OSGi annotations.

Please let me know how to use policyOption = ReferencePolicyOption.Greedy in @Reference OSGI annotation.

Much Appreciated in advance.

Arun Patidar​

Feike Visser​

smacdonald2008​

Thanks

Vijay

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
Community Advisor
Aug 21, 2018 3:31 PM UTC

12 replies

arunpatidar
Community Advisor
Community Advisor
Sep 4, 2018 2:26 PM UTC

Hi,

For my test service, it is in satisfied state.

your issue could be due to dependancy code or something but not sure.

Translate
Arun Patidar
Level 3
Sep 5, 2018 11:39 AM UTC

Hi Arun,

Do you have any idea about No services bound? If you see my above screenshot for the unsatisfied service It shows No Services bound.

Also I have used policyOption:Greedy for three references Where it is satisfied for HybrisConnection and unsatisfied for HybrisFactory & ImportHandler.

Thanks,

Vijay

Translate