The attribute policyOption is undefined for the annotation type Reference | Community
Skip to main content
Level 3
August 21, 2018
Solved

The attribute policyOption is undefined for the annotation type Reference

  • August 21, 2018
  • 12 replies
  • 4275 views

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.

12 replies

arunpatidar
Community Advisor
Community Advisor
September 4, 2018

Hi,

For my test service, it is in satisfied state.

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

Arun Patidar
Level 3
September 5, 2018

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