I got really puzzled about JNDI lookup for local interface in Glassfish2u2.
Whenever I call remote interface like
InitialContext ctx = new InitialContext(); TestingRemote testingBeanJndi = (TestingRemote) ctx.lookup(TestingRemote.class.getName());
It works fine.........
But
InitialContext ctx = new InitialContext();
String strLookUp = ""java:comp/env/ejb/TestingBean"; TestingLocal testingBeanJndi = (TestingLocal) ctx.lookup(strLookUp);
It doesn't work...
I tried
strLookUp = ""java:comp/env/TestingBean";
I also tried like
@Stateless(name="ejb/TestingBeanLocal") // previously I didn't overwrite 'name'
public class TestingBean implements TestingRemote, TestingLocal { }
AND
strLookUp = ""java:comp/env/ejb/TestingBeanLocal";
Not working as well.
Could anyone please help me?
And could I get list for all JNDI env by using any command?
PS -- I am packing in the Beans in ear file.