posted 19 years ago
Thanx chandra for u'r reply.
Well, what I got after playing around a little bit was :- If your client is outside your container, then you cannot just do a "java:comp/env" lookup. This is ONLY for beans/classes inside the container. So now you have to create your own InitialContext using :-
java.util.Hashtable env = new java.util.Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.cosnaming.CNCtxFactory");
env.put(Context.PROVIDER_URL, "corbaloc:iiop:<hostname>:3700");
Context initial = new InitialContext(env);
Object obj = (Object) initial.lookup("/ejb/<bean-jndi-name>");
So, there you specify the machine/ipaddress of the server.
Remember to specify "/ejb" before the jndi name while using lookup.
(just correct me, if I am writing nonsense.... ).
SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCEA