Discussion:
[omniORB] Simultaneous of 2 different implementations
EntonH
2008-06-05 12:48:47 UTC
Permalink
Hi there,

i programmed a Corba application which uses 2 different Corba
implementations at the same time.

The 1st Corba interface:
strcpy(initStr[1], "-ORBInitRef");
strcpy(initStr[2], "NameService=corbaloc::localhost:2809/NameService");
orb = CORBA::ORB_init(cnt, initStr);
// init POA
poa_obj = orb->resolve_initial_references("RootPOA");
poa = PortableServer::POA::_narrow(poa_obj);
manager1 = poa->the_POAManager();
// create service
try {
ns_obj = orb->resolve_initial_references("NameService");
if (!CORBA::is_nil(ns_obj)) {
nc = CosNaming::NamingContext::_narrow(ns_obj);
CosNaming::Name name;
name.length(1);
name[0].id = CORBA::string_dup("TestServer");
name[0].kind = CORBA::string_dup("");
// run
manager1->activate();

The client for this interface looks like this:
# String
string1 = 'NameService=corbaloc::'
string2 = ':2809/NameService'
EndString = string1 + sHostIP + string2

# Initialize the ORB
orb = CORBA.ORB_init (['-ORBInitRef', EndString], CORBA.ORB_ID)
obj = orb.resolve_initial_references("NameService")
rootContext = obj._narrow(CosNaming.NamingContext)

if rootContext is None:
raise IOError('Failed to narrow the root naming context!')

# Resolve the name TestServer
name = [CosNaming.NameComponent("TestServer", "")]
obj = rootContext.resolve(name)

dlClient = obj._narrow(Interface.Comm)

But if I want to call a function of dlClient (dlClient.execFunc(x)) I
get a TRANSIENT exception.

The 2nd Corba application looks like this:
Simultaneously I use the following Corba interface:
con = 'corbaloc::' + sLocalhost + '/' + sType
orb = CORBA.ORB_init(['', con], CORBA.ORB_ID)

# get root poa and its manager; activate the manager
poa = orb.resolve_initial_references("RootPOA")
poaManager = poa._get_the_POAManager()
poaManager.activate()

ior = con
# Convert the IOR to an object reference
obj = orb.string_to_object(ior)

# Narrow reference
ta = obj._narrow(TAInterface.tai)

# initialize and start the model
if ta.init():

I got the TRANSIENT Exception at first (occuring during processing the first
Client implementation)...

I tried modifying the system settings.
Then I got a NotFound exception (command: return _omnipy.invoke(self,
"resolve", _0_CosNaming.NamingContext._d_resolve, args))

I tried to take my modifyings back and now I retrieve an INITILIZE exception
(exception-traceback: File ".\omniORB\CORBA.py", line 459, in __init__).
And...after another try...i retrieve a NO_RESOURCES exception (command:
return _omnipy.orb_func.resolve_initial_references(self, identifier))

How can this be, when all modifications have been removed?
Do you know how I can fix this problem?

Greetings,
EntonH
--
View this message in context: http://www.nabble.com/Simultaneous-of-2-different-implementations-tp17663312p17663312.html
Sent from the OmniORB - User mailing list archive at Nabble.com.
Martin Trappel
2008-06-05 18:56:37 UTC
Permalink
Post by EntonH
Hi there,
i programmed a Corba application which uses 2 different Corba
implementations at the same time.
strcpy(initStr[1], "-ORBInitRef");
strcpy(initStr[2], "NameService=corbaloc::localhost:2809/NameService");
orb = CORBA::ORB_init(cnt, initStr);
// init POA
poa_obj = orb->resolve_initial_references("RootPOA");
poa = PortableServer::POA::_narrow(poa_obj);
manager1 = poa->the_POAManager();
// create service
try {
ns_obj = orb->resolve_initial_references("NameService");
if (!CORBA::is_nil(ns_obj)) {
nc = CosNaming::NamingContext::_narrow(ns_obj);
CosNaming::Name name;
name.length(1);
name[0].id = CORBA::string_dup("TestServer");
name[0].kind = CORBA::string_dup("");
// run
manager1->activate();
# String
string1 = 'NameService=corbaloc::'
string2 = ':2809/NameService'
EndString = string1 + sHostIP + string2
# Initialize the ORB
orb = CORBA.ORB_init (['-ORBInitRef', EndString], CORBA.ORB_ID)
obj = orb.resolve_initial_references("NameService")
rootContext = obj._narrow(CosNaming.NamingContext)
raise IOError('Failed to narrow the root naming context!')
# Resolve the name TestServer
name = [CosNaming.NameComponent("TestServer", "")]
obj = rootContext.resolve(name)
dlClient = obj._narrow(Interface.Comm)
But if I want to call a function of dlClient (dlClient.execFunc(x)) I
get a TRANSIENT exception.
con = 'corbaloc::' + sLocalhost + '/' + sType
orb = CORBA.ORB_init(['', con], CORBA.ORB_ID)
# get root poa and its manager; activate the manager
poa = orb.resolve_initial_references("RootPOA")
poaManager = poa._get_the_POAManager()
poaManager.activate()
ior = con
# Convert the IOR to an object reference
obj = orb.string_to_object(ior)
# Narrow reference
ta = obj._narrow(TAInterface.tai)
# initialize and start the model
I got the TRANSIENT Exception at first (occuring during processing the first
Client implementation)...
I tried modifying the system settings.
Then I got a NotFound exception (command: return _omnipy.invoke(self,
"resolve", _0_CosNaming.NamingContext._d_resolve, args))
I tried to take my modifyings back and now I retrieve an INITILIZE exception
(exception-traceback: File ".\omniORB\CORBA.py", line 459, in __init__).
return _omnipy.orb_func.resolve_initial_references(self, identifier))
How can this be, when all modifications have been removed?
Do you know how I can fix this problem?
Does the C++ Server register itself correctly with the name server?
Is it running when the first client connects?

Have you tried leaving the -ORBInitRef stuff out and setting the
NameService in the configfile/registry ?

On my Windows omniORB412 I normally get a trace message to stdout/stderr
when I recieve INITIALIZE from ORB_init ...

br,
Martin
Martin Trappel
2008-06-06 15:20:48 UTC
Permalink
Now that's strange...
On my laptop it works perfectly...the settings in the registry are the same...what could this be?
From your original email the following things *may* affect the setup:
* omniORB Version (though I will assume you have the same version installed)
* omniORB / omniORBpy installation settings and PATH settings related to
these two
* omniNames configuration (is it running, is it running as a service?)
* Python distribution/version (since you seem to get the error in the
python client)

br,
Martin

Loading...