[omniORB] Access violation when using NameService

Nicolas Boussuge NBoussuge at wyde.com
Mon Aug 26 16:56:47 BST 2013


Hi,

I'm working with omniORB 4.1.7, and I try to use the NameService, but somehow I fail completely to implement my server.

Here's my server code:

         CORBA::Object_ptr poaObj = orb->resolve_initial_references("RootPOA");
         PortableServer::POA_ptr rootPOA = PortableServer::POA::_narrow(poaObj);
         PortableServer::POAManager_ptr manager = rootPOA->the_POAManager(); // get the POA Manager

         // Activate the servant
         Tests * servant = new Tests();
         rootPOA->activate_object(servant);
         HeapTests_ptr server = servant->_this();
         servant->_remove_ref();
         // get a reference to the naming service
         CORBA::Object_ptr serviceObj = orb->resolve_initial_references("NameService");
         CosNaming::NamingContextExt_ptr namingContext = CosNaming::NamingContextExt::_narrow(serviceObj);
         CosNaming::Name * servantName = namingContext->to_name("TestsServer");
         CORBA::Object_ptr servantRef = rootPOA ->servant_to_reference(servant);
         namingContext->rebind(*servantName, servantRef);
         std::cout << orb->object_to_string(server) << std::endl;
         manager->activate(); // Activate the POA Manager
         std::cout << "Pretty much a success !" << std::endl;
         // Internal test, this one works perfectly
         CORBA::Object_ptr serverObj = namingContext->resolve_str("TestsServer");
         HeapTests_var distantServer = HeapTests::_narrow(serverObj);
         CORBA::String_var str;
         distantServer->strout(str);
         std::cout << str._retn() << std::endl;

         orb->run(); // Wait for incoming requests

The test done on the server side using the NameService works correctly. However, when I use another exe to do the exact same test, my server crashes with an access violation in the dispatcher
>             omniORB417_vc10_rtd.dll!omni::GIOP_S::dispatcher()  Line 279 + 0x8 bytes        C++

Is there any problem with my implementation or anything which can cause this exception ?

Thanks
Nicolas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20130826/abbdadfd/attachment.html>


More information about the omniORB-list mailing list