In NetBean, I have a web application called RoleBasedEJB.
I have a class like this :
Client side:
When the @LocalBean is commented out in the resource root class, Glassfish gives me this error when the client tried to access the resource using credentials john/secret.
An EJB with a remote view is not required to be supported as a JAX-RS resource. I am not sure what kind of annotation you have on your StudentService (@Remote maybe?).
Adding the @LocalBean makes the EJB have a local view and that has to be supported by JAX-RS.