|
Hi,
When u lookup , u don't put the HOME name., Instead its r Remote name ( or the name u bound to the registry) It should be
Object ref = jndiContext.lookup(
"java:comp/env/ejb/Customer");
EJBHome home = (EJBHome) PortableRemoteObject.narrow(ref, CustomerHome.class); You need to initialize the
InitialContext(..) with the properties of
ur application server, if ur client program is not in the same JVM.
Properties h = new Properties();
//factory=org.jnp.interfaces.NamingContextFactory
//url=jnp://myhost:1099 h.put(Context.INITIAL_CONTEXT_FACTORY, factory); h.put(Context.PROVIDER_URL, url); if (user != null) { h.put(Context.SECURITY_PRINCIPAL, user); if (password == null) password = ""; h.put(Context.SECURITY_CREDENTIALS, password); } ctx = new
InitialContext(h);
Object ref = ctx.lookup("BeanToFind"); EJBHome home = (EJBHome) PortableRemoteObject.narrow(ref, type); Harish
|
- JRun/JNDI Question Galbreath, Mark
- Re: JRun/JNDI Question ^BoyInterrupted^
- Re: JRun/JNDI Question Ronald Wildenberg
- Re: JRun/JNDI Question Venu Gopal
- Re: JRun/JNDI Question Tom�s( Marek
- Re: JRun/JNDI Question Harish K Kottarathil
- Re: JRun/JNDI Question Colin Capriati
- Re: JRun/JNDI Question Galbreath, Mark
- Re: JRun/JNDI Question Gayathri Palicherla
- folder display on web Venu Gopal
- Re: folder display on web Soubhratra Das
- Re: JRun/JNDI Question Albert Pi
