[omniORB] how to set the argument "-ORBInitref" in namingservice on vxworksplatform
Tonny.W
747922371 at qq.com
Wed May 30 11:50:32 BST 2018
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()
{}
.....
}
------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20180530/fb4a3373/attachment.html>
More information about the omniORB-list
mailing list