users@glassfish.java.net

RE: Re: Problems with EJB External Client..

From: Jason Lee <lee_at_iecokc.com>
Date: Fri, 23 Jun 2006 14:53:05 -0500

Right or wrong, all I do before I get the InitialContext, I do just
this:

        System.setProperty("org.omg.CORBA.ORBInitialHost", server);

Then do my lookup. Works well for me, but I only use it in my test
cases.


--
Jason Lee
Programmer/Analyst
-----Original Message-----
From: Dyego Souza Dantas Leal [mailto:dyego.leal_at_gmail.com] 
Sent: Friday, June 23, 2006 2:47 PM
To: users_at_glassfish.dev.java.net
Subject: Re: Problems with EJB External Client..
I change the code to:
     System.setProperty("org.omg.CORBA.ORBInitialHost", "192.168.0.1");
       System.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
       System.setProperty("com.sun.appserv.iiop.endpoints",
"192.168.0.1:3700");
       System.setProperty("com.sun.CORBA.connection.ORBSocketFactory",
"com.sun.enterprise.iiop.IIOPSSLSocketFactory");
       InitialContext ic = new InitialContext();
       System.out.println("Hey The Obj is ! 
"+ic.lookup(MyLittleSessionBeanRemote.class.getName()));
And everythink works fine... i'm afraid with this !!!!
The question is , Why ?
Dyego Souza Dantas Leal escreveu:
> 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(Tab
elaCustaSessionBeanTest.java:42) 
>
> Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: 
> IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
>        at 
>
org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelpe
r.java:72) 
>
>        at 
>
org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.ja
va: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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
For additional commands, e-mail: users-help_at_glassfish.dev.java.net