I was trying figure out the cause of another exception for my dynamic web app here - https://github.com/double-whammy/affablebean I made a small change and I got a new exception - javax.ejb.AccessLocalException: Client not authorized for this invocation
An online answer says that I do the following - http://ask.ozar.net/11/javax-accesslocalexception-client-authorized-invocation
Try deleting the generated policy file(s). You should be able to locate them under C:\glassfish-3\glassfish\domains\domain1\generated\policy. substitute your domain name with domain1
Another says more - http://glassfish.10926.n7.nabble.com/Persisting-Entity-javax-ejb-AccessLocalException-Client-not-authorized-for-this-invocation-td11197.html
you can find the policy file under domains/domainx/generated/policy///{granted.policy,excluded.poliy} positive grants are in granted.policy, negative grants are in excluded.policy (if any). (In domaninx, x =1,2,3 etc...)
look in granted.policy for an "unqualified grant of an EJBMethodPermission, with name = the EJbName of your session bean; which I think may be JpaPersonDao. and with a method spec that applies to the save method.
I tried the second one and I see many folders under my glassfish folder: C:\glassfish4\glassfish\domains\domain1\generated\policy
C:.
├───AffableBean
│ ├───AffableBean
│ │ granted.policy
│ │
│ └───AffableBean_internal
│ granted.policy
│
├───__admingui
│ └───__admingui
│ excluded.policy
│ granted.policy
│
└───__default-web-module
└───__default-web-module
granted.policy
As you can see, there are so many granted.policy files. Which one should I fix ? Is it the one under first folder ?
I think the root problem is because of cache of glassfish server because you make some modification in the existing EJB class.
To solve this problem you just need to clear folder/directory "generated" in domain folder, and restart your glassfish server to refresh.