[omniORB] RE: How to run example on different host ? (fanny)
JHJE (Jan Holst Jensen)
jhje at novonordisk.com
Mon May 26 16:45:25 BST 2003
> I am new on omniORB, I am try to run example 2 and 3 on different
> host(Host Server, Host Client)
[...]
> I try to modify in eg2_clt.cc as follows :
> //CORBA::Object_var obj = orb->string_to_object(argv[1]);
> CORBA::Object_var obj =
> orb->string_to_object("corbaloc:iiop:1.2 at Server:2809/NamesService");
> Echo_var echoref = Echo::_narrow(obj);
[...]
> then, I can see the Connection information in Server from
> Client , but
> it seems not work , because they don't say "hello" to each other,
Hi Fanny.
If you are running the eg3_impl somewhere, and a naming server (e.g.
omniNames) on names.company.com, the following will work:
CORBA::Object_var obj =
orb->string_to_object("corbaname::names.company.com/NameService#test.my_cont
ext/Echo.Object");
What you get from "corbaloc:iiop:1.2 at Server:2809/NameService" (NameService,
not NamesService) is only a reference to the name server on "Server" (if it
is running on "Server") and not a reference to the Echo object. So your code
raises an exception when trying to narrow the object reference.
So, make sure that you have omniNames up and running, and make sure that
eg3_impl registers itself with that name server (setup -ORBInitRef
NameService=... correctly).
If you are running the eg2_impl I believe that you would have to specify
explicit server ORB endpoints for "corbaloc:..." to work. I have not tried
this though. I would strongly recommend using the name server instead.
Best Regards
-- Jan Holst Jensen, Novo Nordisk A/S
More information about the omniORB-list
mailing list