the java:comp/env only works when called from javaee components, not gbeans.

You could use a gbean reference to the EjbContainer (??) gbean that is deployed when the ejb is deployed and then figure out what to call to get the MEJB itself.

Or, if this gbean is called from javaee components you could look up the MEJB during such a call, and make sure you have an ejb-ref to it in the javaee component.

thanks
david jencks

On Oct 12, 2007, at 10:10 AM, Viet Nguyen wrote:

Hi All,

I am trying to access the new MEJB from a gbean. I am using the following

Context ic = new InitialContext();
Object mejbObj = (Object)ic.lookup("java:comp/env/ejb/mgmt/ MEJB"); // I get a NotContextException here

I have tried to pass a Properties object (with the javax.naming.security.principal and javax.naming.security.credentials) to the InitialContext() constructor, but I get the same exception.

I think this is the correct JNDI name for MEJB. Is this problem due to the new security checks? If so, how can I configure my gbean (which is actually bundled inside an EAR) to be able to access the MEJB?

Thanks,
Viet

Reply via email to