users@glassfish.java.net

Problems with EJB External Client..

From: Dyego Souza Dantas Leal <dyego.leal_at_gmail.com>
Date: Fri, 23 Jun 2006 16:16:02 -0300

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 ?