2 //=============================================================================
6 * This program tests if accessing the POA current before the
7 * RootPOA can cause any problems.
9 * @author Irfan Pyarali
11 //=============================================================================
15 #include "tao/PortableServer/PortableServer.h"
17 #include "ace/Log_Msg.h"
20 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
25 // Initialize the ORB first.
26 CORBA::ORB_var orb
= CORBA::ORB_init (argc
, argv
);
28 CORBA::Object_var object
;
30 object
= orb
->resolve_initial_references ("POACurrent");
32 PortableServer::Current_var current
=
33 PortableServer::Current::_narrow (object
.in ());
35 object
= orb
->resolve_initial_references ("RootPOA");
37 PortableServer::POA_var root_poa
=
38 PortableServer::POA::_narrow (object
.in ());
46 catch (const CORBA::Exception
& ex
)
48 ex
._tao_print_exception ("Exception caught");