0

I am missing something real simple. I am trying to add a @Resource annotation to a setter method.

import org.springframework.stereotype.Component;
import javax.annotation.Resource;
.
.
@Resource
public void setCenter(Point center) {
    this.center = center;
}

I got the following error. What is it looking for ?

enter image description here

tadpole
  • 1,209
  • 7
  • 19
  • 28
  • 2
    Does this answer your question? [Access restriction: The type 'Application' is not API (restriction on required library rt.jar)](https://stackoverflow.com/questions/25222811/access-restriction-the-type-application-is-not-api-restriction-on-required-l) – Madhu Bhat Dec 24 '19 at 16:07
  • See https://javahonk.com/access-restriction-the-type-resource-is-not-api/ – Ori Marko Dec 24 '19 at 16:08
  • Thank you Madhu. I am still not sure what that error means but that solution did the trick. – tadpole Dec 24 '19 at 16:15
  • For anyone who will encounter the same error, I followed the link instructions and set the Access Rules value to "javax/annotation/**". – tadpole Dec 24 '19 at 16:24

0 Answers0