[omniORB] list names in naming service

jian peng jian_peng@rocketmail.com
Fri Jun 14 19:18:01 2002


Duncan Grisby wrote:

> > Thank you guys for your reply. After I changed the
VC settings, my
> > program compiled. And now I have a new question.
We have a Linux
> > machine running omniORB2.4, and I want to access
corba servers from my
> > Windows NT machine.
> 
> Do you really mean omniORB 2.4?  That was released
over 4 and a half
> years ago. It is terribly obsolete.
>

Yes, I know it's terribly obsolete. However, it comes
with a software package to control a mobile robot, and
it seems we have to stick to this software package for
a while:-(
 
> >   Attached is my code to access the naming service
> > on the Linux machine - machine name is scooter -
from my windows
> > machine. I ran my program as:
> > 
> > list2 -ORBInitRef
NameService=iioploc://scooter:1358/NameServie
> 
> omniORB 2.4 pre-dates the interoperable naming
service specification
> by about 3 years, so it's hardly surprising that it
doesn't support
> -ORBInitRef. Also, your syntax is wrong. If you were
using omniORB 3
> or 4, the command would be
> 
>   list2 -ORBInitRef
NameService=corbaloc::scooter:1358/NameService

I just updated the omniORB on my Windows machine from
2.5 to 3.0. I also found out the IOR string of naming
service on Scooter, so now I can get the root context
using this IOR string. The name of my object is
"compass.Mobility/something_I_don't_know/don't_know_either",
so I tried to use list() to retrieve the whole name.
Here is my code:

  // try to list naming context
  CosNaming::BindingList_var   basicListV;
  CosNaming::BindingIterator_var bIterV;

  rootContext->list(10, basicListV, bIterV);

  CORBA::Object_var objV;
  CosNaming::NamingContext_var tmpContextV;

  CosNaming::Name name2;
  name2.length(1);
  name2[0].id   = (const char*) "compass";  
  name2[0].kind = (const char*) "Mobility";

  objV = rootContext->resolve(name2);
  tmpContextV =
CosNaming::NamingContext::_narrow(objV);

  CosNaming::BindingList_var   basicListV2;
  CosNaming::BindingIterator_var bIterV2;

  tmpContextV->list(10, basicListV2, bIterV2);

The last sentence raised a system exception, and
here's the screen output:

omniORB: ERROR -- the application attempted to invoke
an operation on a nil reference.
Caught a system exception.

What's wrong in my code?

Have a great weekend!

Jian

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com