Attempting to connect to CORBA service using corbaloc url

    String[] orbargs= {};
    org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(orbargs, null);
    org.omg.CORBA.Object cobj = orb.string_to_object("corbaloc:iiop:10.1.1.200:6969/OurServiceHelper");
    _OurServiceHelper cpsh = _OurServiceHelperHelper.narrow(cobj); // Get stuck
    cpsh.ourMethod();

This narrow one just hangs.

My service is configured to work on a static port. And we know that this works, as we usually view it through the NamingService.

What am I doing wrong?

+3
source share
3 answers

NamingService, URL- corbaname URL- corbaloc. , 6969. "OurServiceHelper" 6969, NamingService , url 6969. ior, NamingService, .

"corbaname:10.1.1.200:6969#OurServiceHelper"

Re: : IOR . , , PERSISTENT POA, . , IOR ip , , IOR, , IP- , .

, . , , , , .

, . url corbaloc, Interoperable Naming Service (INS). .: http://java.sun.com/j2se/1.4.2/docs/guide/idl/INStutorial.html. INS, NamingContextExt. , corabloc url, NamingContextExt::resolve_str URL-.

+1

URL- corbaloc ( ) , .

?

:

<server> -ORBInitRef OurServiceHelper="file://server.ior"

, corbaloc , ior ior. ORB , TAO , , IORTable.

0

There is no type information in corbaloc, so the ORB checks the type you are narrowing down by making a remote call (_is_a). Try using an unchecked narrow one that won't call _is_a:

_OurServiceHelper cpsh = _OurServiceHelperHelper.narrow(cobj);

It is odd that calling _is_a does not return for you. I assume that unchecked_narrow will work (you will get a non-zero result), but the reference to the object will not work.

0
source

Source: https://habr.com/ru/post/1744741/


All Articles