03 October 2011

GlassFish Error - javax.ejb.AccessLocalException: Client not authorized for this invocation

If you are using GlassFish (along with NetBeans and facing this error when invoking an EJB from a Servlet or any  web layer class using @EJB inject, clear the generated policy files and redeploy the application.

Ensure a line for the (newly added or renamed) method being accessed is present in the policy file. An example is provided below.

permission javax.security.jacc.EJBMethodPermission "ExamManagementEJB", "getQuestionTags,Local,com.packagename.entity.SomeEntity";