The JEE tutorial says at http://docs.oracle.com/javaee/5/tutorial/doc/bnbyl.html
However, the specification says the method permission overrides the annotations.Defining Security Roles
....
You can augment the set of security roles defined for the application by annotations using the security-role deployment descriptor element to define security roles, where you use the role-name element to define the name of the security role.
As the example shown in my previous post, I use GlassFish 3.1.2 to implement the question in ejbd.v6.2.616.
The dd defines customer as the role to access the two doStuff methods.
In one of the doStuff() method, it is annotated as @RolesAllowed("user").
As I tried, a user role is not allowed to access doStuff() as the dd overrides the role by customer.
I wonder this feature may be application server specific. Maybe, GlassFish uses dd to override annotations. Maybe, other servers uses dd to augment annotations.