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
[])
24 // Initialize the ORB first.
25 CORBA::ORB_var orb
= CORBA::ORB_init (argc
, argv
);
27 CORBA::Object_var object
;
29 object
= orb
->resolve_initial_references ("POACurrent");
31 PortableServer::Current_var current
=
32 PortableServer::Current::_narrow (object
.in ());
34 object
= orb
->resolve_initial_references ("RootPOA");
36 PortableServer::POA_var root_poa
=
37 PortableServer::POA::_narrow (object
.in ());
45 catch (const CORBA::Exception
& ex
)
47 ex
._tao_print_exception ("Exception caught");