[omniORB] Simultaneous use of 2 different implementations
Martin Trappel
0xCDCDCDCD at gmx.at
Thu Jun 5 15:56:17 BST 2008
EntonH wrote:
> 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?
>
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
More information about the omniORB-list
mailing list