geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rodney B. Cabahug" <rodney.caba...@gmail.com>
Subject Re: A question about jndi
Date Wed, 26 Aug 2009 10:47:40 GMT
Hello Rodger,
Try this..
Properties p  = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"org.openejb.client.RemoteInitialContextFactory");
p.put(Context.PROVIDER_URL, "ejbd://localhost:4201");
Context c = new InitialContext(p);
Echo echo = (Echo) c.lookup("EchoRemote");

Regards,
Rodney

On Wed, Aug 26, 2009 at 6:23 PM, Rodger <eternaljian@gmail.com> wrote:

> Hi,
> I have a remote interface *my.test.Echo* and a ejb *my.test.EchoBean*.
> I don't do any configuration for the jndi in deployment descriptor and
> deployment plan.
>
> Then using
> *@EJB(name="my/test/Echo")
> private Echo echo;
> *can find the ejb and run successfully.*
> *
> But why using
> *Context ctx = new InitialContext();
> Echo echo = (Echo)ctx.lookup("java:comp/env/my/test/Echo"); *
> there is:
>
> *javax.naming.NotContextException: my/test/Echo
>
> *Who can help me?*
> *
>
> Geronimo version 2.2
> --
> Best Regards,
> Rodger.
>

Mime
View raw message