2

I'm using Glassfish 3.0.1. I sometimes get this error when attempting to call a local EJB:

[#|2010-11-10T19:17:25.014+0000|INFO|glassfish3.0.1|javax.enterprise.system.core.security|
_ThreadID=26;_ThreadName=Thread-1;|JACC Policy Provider: Failed Permission Check,
context(myApplication/myWarModule-1_0-SNAPSHOT_war_internal)- 
permission((javax.security.jacc.EJBMethodPermission MyEJB myMethod,Local,java.lang.Long))|#]

[#|2010-11-10T19:17:25.015+0000|WARNING|glassfish3.0.1|
javax.enterprise.system.container.ejb.com.sun.ejb.containers|_ThreadID=26;
_ThreadName=Thread-1;|A system exception occurred during an invocation on EJB 
MyEJB method public void com.example.MyEJB.myMethod(java.lang.Long)
javax.ejb.AccessLocalException: Client not authorized for this invocation.
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1850)
    at com.sun.ejb.containers.EjbAsyncTask.call(EjbAsyncTask.java:95)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)

99% of the time, everything works fine. But when it happens, then every attempt to call that EJB method results in the same error. The only way to fix it is to undeploy the application, and deploy again. Can anybody tell me what's going on?

Mike Baranczak
  • 8,291
  • 8
  • 47
  • 71
  • How have you implemented your EJB security? Is it through AOP cross cutting or some other method? It could be that your configuration fails under certain cases, it could also simply be a Glassfish bug :) – Martijn Verburg Nov 11 '10 at 15:58
  • Sounds like a deadlock. Could be in your app code, but also could be in the container. Next time it happens get a heapdump (kill -QUIT ) before doing the redeploy workaround. If a user sent me a heapdump when reporting a possible threading issue, I'd probably send them flowers :) – David Blevins Nov 27 '10 at 20:16
  • 3
    A little late, but I'd like to tell people that I was able to solve the problem by shutting down Glassfish and deleting the application's generated policy files. See Pascal Thivent's answer: http://stackoverflow.com/a/3589170/365719 – Mike Baranczak Apr 17 '12 at 21:52
  • @MikeBaranczak your suggestion helped very well. it would be nice to re-add it a solution – youssef Sep 19 '14 at 16:31

0 Answers0