Description
When calling the getWisdom() method from the EJB below from a rest resource (principal = anonymous), it throws an exception. If I add @PermitAll it does not throw an exception.
According to jsr-250: "the @DeclareRoles would be used to define roles that could be tested. It could also be used to declare roles that are not implicitly declared as the result of their use in a RolesAllowed annotation on the class or a method of the class."
@Singleton
@DeclareRoles("dukes")
public class Greetings {
private String wisdom;
@PostConstruct
public void initialize()
public void setWisdom(String wisdom)
{ this.wisdom = wisdom; }public String getWisdom()
{ return userid + " said " + wisdom; }}