[omniORB] omniINSPOA and bidir connections (omniORB4)

Rob Eger reger@txcorp.com
Fri Sep 6 16:41:02 2002


I've gotten a simple hello app working with omniINSPOA in order to use
corbaloc from the client, but now I want to make it work
bidirectionally.  I started with the bidir example code from omniORB4
and tried to alter it to use omniINSPOA as shown in the code below.


      CORBA::Object_var obj =
orb->resolve_initial_references("omniINSPOA");
      PortableServer::POA_var insPOA =
PortableServer::POA::_narrow(obj);
      PortableServer::POAManager_var pman = insPOA->the_POAManager();
      pman->activate();

     // Create a POA with the Bidirectional policy
      CORBA::PolicyList pl;
      pl.length(1);
      CORBA::Any a;
      a <<= BiDirPolicy::BOTH;
      pl[0] = orb->create_policy(BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE,
a);

      PortableServer::POA_var bidirPOA = insPOA->create_POA("BiDirPOA",
pman, pl);

      PortableServer::ObjectId_var oid =
PortableServer::string_to_ObjectId("bidirHello");

      server_i* myserver = new server_i();

      bidirPOA->activate_object_with_id(oid.in(), myserver);


It throws a BAD_PARAM (InvalidSystemId) exception on the last line.  If
I change the last line to:

	insPOA->activate_object_with_id(oid.in(), myserver);

it works, but not bidirectionally obviously.  I can get the same app to
work bidirectionally if I change it to use the IOR and RootPOA, but we'd
prefer to not make the client use IOR, and we'd like to avoid using the
NameService (one less service needing to run).

Ideas?

Thanks for your help,
Rob.


------------------------------------------------------
 Rob Eger           | email: reger@txcorp.com
 Tech-X Corporation | voice: 303.444.2451
 Boulder, CO        |   fax: 303.448.7756
                    |   www: http://www.techxhome.com
------------------------------------------------------