users@glassfish.java.net

Re: Problems with EJB External Client..

From: Hong Zhang <Hong.Zhang_at_Sun.COM>
Date: Fri, 23 Jun 2006 15:40:56 -0400

The most common problem developers run into is passing specific JNDI
bootstrapping properties to InitialContext(args), so it's not
recommended you set it yourself.

Please read this EJB FAQ topic on this:

https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#StandaloneRemoteEJB

- Hong

Dyego Souza Dantas Leal wrote:

> I have a EJB Application deployed in host 192.168.0.1
>
> And i writing a client in my workstation (192.168.0.2)
>
> I need to write an EJB3 CLIENT APP to execute my session ben (inside
> 192.168.0.1)
>
> I'm using on client:
>
>
> System.setProperty("java.naming.factory.initial",
> "com.sun.jndi.cosnaming.CNCtxFactory");
> System.setProperty("java.naming.provider.url",
> "iiop://192.168.0.1:3700");
> InitialContext ic = new InitialContext(System.getProperties());
> System.out.println("Hey The Obj is !
> "+ic.lookup(MyLittleSessionBeanRemote.class.getName()));
>
>
> But i got an error :
>
>
> javax.naming.NameNotFoundException [Root exception is
> org.omg.CosNaming.NamingContextPackage.NotFound:
> IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
> at
> com.sun.jndi.cosnaming.ExceptionMapper.mapException(ExceptionMapper.java:44)
>
> at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:453)
> at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)
> at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:470)
> at javax.naming.InitialContext.lookup(InitialContext.java:351)
> at
> br.com.escriba.document5.session.TabelaCustaSessionBeanTest.testPing(TabelaCustaSessionBeanTest.java:42)
>
> Caused by: org.omg.CosNaming.NamingContextPackage.NotFound:
> IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
> at
> org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
>
> at
> org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:406)
>
> at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:440)
> ... 19 more
>
>
>
> * BUT * If goto ADMIN CONSOLE and click in "JNDI BROWSING" the object
> is published in JNDI Tree...
>
>
> What's wrong ?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>