users@glassfish.java.net

Re: Caused by: javax.ejb.AccessLocalException: Client not authorized for this i

From: <glassfish_at_javadesktop.org>
Date: Thu, 08 Jul 2010 20:45:58 PDT

In fact if I replace the @EJB by a context lookup It solve the trouble:
So I believe that I can not use @EJB into another EJB
Could someone tell me if is or not a glassfish bug ?

see the replacing code:
@Stateless
public class SampleEJB implements SampleEJBLocal {

    TestEJBLocal testEJB;

    public SampleEJB() {
    }

    @PostConstruct
    void init() {
        try {
            InitialContext context = new InitialContext();
            testEJB = (TestEJBLocal) context.lookup("java:global/Sample/Sample-ejb-1.0-SNAPSHOT/TestEJB");
        } catch (NamingException e) {
        }

    }

    public int test(int value) {
        testEJB.theTest();
        return 2;
    }
}
[Message sent by forum member 'zolive2']

http://forums.java.net/jive/thread.jspa?messageID=477164