c++corbavisual-c++-6omniorb

resolve_initial_references causes a SystemException


We use an ActiveX control in our client, developed with Visual C++ 6.0, in our application. We also use omniORB 2.7 to provide the connection to the server app. It's been working fine; but right now we need to run this application on a Windows 7, 64-bit PC. The ActiveX control is working; but in the C++ code, when it calls ORB's resolve_initial_references function as below:

try 
{
    // Obtain a reference to the root context of the Name service:
    CORBA::Object_var initServ;
    initServ = orb->resolve_initial_references("NameService");
}   
catch(CORBA::ORB::InvalidName& ex)
{
    FormAndOpenHataDialog("Service Required is Invalid [does not exist] !", __FILE__, __LINE__);
    return CORBA::Object::_nil();
}
catch(CORBA::SystemException & ex)
{       
    FormAndOpenHataDialog(ex.NP_RepositoryId() , __FILE__, __LINE__);
    return FALSE;
}

It throws a SystemException. It didn't do this on XP, 32-bit machines. I tried to find out the cause of the exception; but all I could get out was NP_RepositoryId(); and it prints: IDL:omg.org/CORBA/NO_RESOURCES.

I don't think it has a connection problem; because ORB's init() function works without a problem. I also don't think the allowed number of connections are being exceeded; that doesn't make sense. It just says NO_RESOURCES. I tried to print the minor code; but it comes up empty. What else can I do?

Edit: I start the server application with these: -ORBInitialHost 192.168.1.8 -ORBInitialPort 900 -BOAiiop_port 5140


Solution

  • It sounds like your client is having trouble finding the initial reference to the name service. Check how you give this information to the client, i.e. omniORB config file, environment variable, command-line argument, or registry (on Windows).