users@glassfish.java.net

where to find jndi name?

From: Angelo Chen <angelochen960_at_yahoo.com.hk>
Date: Sun, 3 Feb 2008 08:19:08 -0800 (PST)

Hi,

I have this :
@Remote
public interface HelloRemote {
    public String sayHi();
}

@EJB
private HelloRemote helloRemote = null;

somewhere in the code, I can say:

String msg = helloRemote.sayHi();

above code works, now I need to use lookup in another place, here is what I
did:
  InitialContext ic = new InitialContext();
  Object obj = ic.lookup(HelloRemote.class.getName());
  helloRemote = (HelloRemote) obj;
  String msg = helloRemote.sayHi();

I always get error :

ejb3.HelloRemote not found at
com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:216)
at
com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:188)
at
com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:74)
at

what is the correct jndi string shoud I use in the lookup? i browse
Glassfish's jndi view, there was no entry. any idea? Thanks,

Angelo












-- 
View this message in context: http://www.nabble.com/where-to-find-jndi-name--tp15254987p15254987.html
Sent from the java.net - glassfish users mailing list archive at Nabble.com.