[omniORB] "ServantAlreadyActive" exception.
Ben Miller
Ben.Miller@Mercia.Com
Tue, 4 Jul 2000 12:50:31 +0100
Hi all,
I'm just updating my project to use omniORB3 (instead of
omniORB2.7.1). I have code like this:
// Initialise the Object Request Broker.
cout << "Initialising ORB..." << endl;
orb = CORBA::ORB_init(argc, argv, 0);
cout << "... ORB initialised." << endl;
// Initialise the root portable object adapter.
cout << "Initialising POA..." << endl;
CORBA::Object_var temp_obj =
orb->resolve_initial_references("RootPOA");
PortableServer::POA_var poa = PortableServer::POA::_narrow(temp_obj);
cout << "... POA initialised." << endl;
// Create a new object implementation
cout << "Creating the LongJob implementation..." << endl;
LongJobImpl* impl = new LongJobImpl;
LongJob_var obj_ref = impl->_this(); // Get object reference.
// Register servant object with POA.
PortableServer::ObjectId_var myImpl = poa->activate_object(impl);
I try to run this code (as my persistent server) and the very last
line throws a "ServantAlreadyActive" exception. What could I be doing
wrong here?
Regards,
Ben Miller
Mercia Software Ltd.
Mercia House
Ashted Lock
Aston Science Park
Birmingham B7 4AZ, UK
Registered Number: 1868855 (Cardiff)
Tel: 44 (0)121 359 5096
Fax: 44 (0)121 359 0375
Web Site: http://www.mercia.com