Re: how to set the argument "-ORBInitref" in namingservice on vxworksplatform
Tonny.W via omniORB-list <[email protected]> Wed, 30 May 2018 18:50:32 +0800
| Newsgroups | gmane.comp.corba.omniorb.user |
|---|---|
| Message-ID | <[email protected]> |
Thank you for your reply. vxworks does not support environment and configuration file.
The following code is how I set the arguments and options in the file "omniNames.cc":
void *CNamingService::void *CNamingService::run_undetached( void * )
{
int argc = 3;
char *argv[3] = {""};
// Fill-in the port option
argv[1] = "-ORBendPoint";
argv[2] = m_pszPort; //m_pszPort="giop:tcp:127.0.0.1:5000"
const char*options[][2]={{"InitRef","NameService=cobaname:iiop:127.0.0.1:5000/Nameservice"},{0,0}};
CORBA::ORB_ptr orb;
try {
orb = CORBA::ORB_init(argc, argv,"omniORB4",options);
}catch....
}
The following is the exception when I compile and excute the example "eg3_impl.cc":
Caught corba::OBJECT_NOT_EXIST.
static CORBA::Boolean
bindObjectToName(CORBA::ORB_ptr orb, CORBA::Object_ptr objref)
{
CosNaming::NamingContext_var rootContext;
try {
// Obtain a reference to the root context of the Name service:
CORBA::Object_var obj = orb->resolve_initial_references("NameService");
// Narrow the reference returned.
rootContext = CosNaming::NamingContext::_narrow(obj); //the excetion occurs here
......
catch()
{}
.....
}
------------------
_______________________________________________
omniORB-list mailing list
[email protected]
http://www.omniorb-support.com/mailman/listinfo/omniorb-list