EJB with JNDI not listed in the glassfish JNDI list -
i have made ejb jndi, using annotations.
made jar of ejb code , deployed in glassfish server (version 3).
able object of ejb in remote client application, using jndi lookup.
not able ejb name or mappedname
in glassfish jndi list.
use command asadmin list-jndi-entries
list of jndi entries.
@remote public interface testejbjndi { public object test(); }
@stateless(name="testsdkinterface", mappedname="/test/ejb/jndi") public class testejbjndiimpl implements testejbjndi{ @override public object test(){ system.out.println("inside getprotocoldata"); return null; } }
public class remoteclient { public static void main(string[] args) { try { context ctx = new initialcontext(); lookup(ctx); } catch (namingexception ne) { ne.printstacktrace(); } } private static void lookup(context ctx) throws namingexception { system.out.println("inside lookup"); try{ object object = ctx.lookup("/test/ejb/jndi"); system.out.println("lookup done, object :"+object); testejbjndiimpl teji= (testejbjndiimpl)object; teji.test(); }catch(namingexception ne){ ne.printstacktrace(); } } }
Comments
Post a Comment