[omniORB] trouble destroying ORB and re-initializing it
David Konerding
dek@cgl.ucsf.EDU
Fri, 07 Sep 2001 16:11:32 -0700
Hi, I am working on a program where the user can choose the naming
service host before the ORB is started up. Later, they can change
the naming service host to a different one. I am having problems destroying
the ORB, if I do that, then a later attempt to use "resolve_initial_references"
will dump core (the traceback is not very useful, I think the stack got munged).
I am using omniORB 3.0.3.
Here's the example code:
import sys
from omniORB import CORBA
import CosNaming
def listCollabs(orb):
nameserver=orb.resolve_initial_references("NameService")
nameserver = nameserver._narrow(CosNaming.NamingContext)
path = [CosNaming.NameComponent('Collaboratory', '')]
ns = nameserver.resolve(path)
result=ns.list(1000)
list = []
for i in result[0]:
for j in i.binding_name:
list.append(j.id)
print list
naming_service = "corbaname::host1"
argv = ['', "-ORBInitRef", "NameService=%s" % naming_service]
orb = CORBA.ORB_init(argv, CORBA.ORB_ID)
listCollabs(orb)
orb.destroy()
naming_service = "corbaname::host2"
argv = ['', "-ORBInitRef", "NameService=%s" % naming_service]
orb = CORBA.ORB_init(argv, CORBA.ORB_ID)
listCollabs(orb)
-----------------------------------------------------------------------------
David Konerding
Email: dek@cgl.ucsf.edu
WWW: http://www.cgl.ucsf.edu/home/dek
-----------------------------------------------------------------------------