[Orbit-python-list] are you alive? and the "orbit-python" project?
Status: Inactive
Brought to you by:
tack
From: Eugene P. S. <eu...@en...> - 2002-05-28 06:18:27
|
Hello, Tack! I have a question about using CORBA NamingService with orbit-python (using o-p from gnome cvs). When I do 'import CosNaming' where the CosNaming module imported from? And why it's only NamingService and not InteroperableNamingService as in ORBit2 (no NamingContextExt interface implementation)? Also, any NamingContext function calls is CORBA.COMM_FAILURE (and the orbit-name-service-2 process is aborted after the function aborted). Here is my test code: #!/usr/bin/python2.2 # server.py import sys try: import CORBA, CosNaming except: print "Can't import CORBA stuff, exiting" sys.exit(-1) orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID) root_poa = orb.resolve_initial_references("RootPOA") deas_poa = root_poa ns_ior_filename = "./ins.ior" # for registering servants with the CORBA NamingService # FIXME: where can I get the ior from? root_ns_nc = orb.string_to_object(open(ns_ior_filename).readline())._narrow(CosNaming.NamingContext) name = [CosNaming.NameComponent()] # register DEAS naming context with the CORBA NamingService name[0].kind = 'DEAS context' name[0].id = 'root' try: deas_ns_nc = root_ns_nc.new_context()._narrow(CosNaming.NamingContext) except: print 'Can not create NameService CosNaming.NamingContext instance' sys.exit(-3) # !!! Always aborted here !!! root_ns_nc.rebind_context(name, deas_ns_nc) # activate the POAManager poa_manager = deas_poa.the_POAManager() poa_manager.activate() # run the ORB orb.run() |