Null naming context while requesting NameService



Hi,
	I'm trying to get started with ORBit programming, I successfully
managed to write my first "HelloWorld" using the IOR and now I'm trying to
make it evolve in order to use NameService, the problem is that when i try
to get the NamingContext i get a null referance here:

/* ... */
  CosNaming_NamingContext nc;
  CORBA_Environment * ev; 
  ev = g_new0(CORBA_Environment,1);   
  CORBA_exception_init(ev);   
  orb = CORBA_ORB_init(&argc, argv, "orbit-local-orb", ev);
  checkEx(ev);
  nc = CORBA_ORB_resolve_initial_references(orb,"NameService",ev);
  /* checkEx is a simple function that exits if ev->_major is not 
CORBA_NO_EXCEPTION. */
  checkEx(ev);
  /* check wether nc is null */
  if(nc == NULL){
    printf("Cannot resolve service \n");
    exit(1);
  }
/* ... */

I put the naming context check after CosNaming>NamingContext>bind produced
SEGV.
I always get "Cannot resolve service"

I don't know what to do to make it work, can some one help me ?

thx.

-- 

Omar Benhamid
Ecole Centrale Paris





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]