[omniORB] Java, Python, CORBA
Jakub Moskal
jmoskal at ece.neu.edu
Wed Feb 11 12:08:59 GMT 2009
William,
here is what I get:
javaParams = ["ORBInitialHost", "localhost", "ORBInitialPort" "900"]
orb = CORBA.ORB_init(javaParams, CORBA.ORB_ID)
obj = orb.string_to_object("corbaloc::localhost:900/NameService")
rootContext = obj._narrow(CosNaming.NamingContext) // exception thrown
throws: omniORB.TRANSIENT_ConnectFailed.
I have no idea what is wrong at this point.. Is there anything I need
to do with "-ORBno_bootstrap_agent" ?
Thanks!
Jakub
On Wed, Feb 11, 2009 at 11:51 AM, William Bauder <bill at simplified.biz> wrote:
> I don't know how it works with the orb init parameters, but this always
> worked for me:
>
> CORBA::Object_ptr
> object=orb->string_to_object("corbaloc::localhost:900/NameService");
> CosNaming::NamingContext_ptr
> rootContext=CosNaming::NamingContext::_narrow(object);
>
> -----Original Message-----
> From: omniorb-list-bounces at omniorb-support.com
> [mailto:omniorb-list-bounces at omniorb-support.com] On Behalf Of Jakub Moskal
> Sent: Wednesday, February 11, 2009 11:36 AM
> To: Duncan Grisby
> Cc: OmniORB Support
> Subject: Re: [omniORB] Java, Python, CORBA
>
>
> Duncan,
>
> I went after your advice and changed my python client code to:
>
> javaParams = ["ORBInitialHost", "localhost", "ORBInitialPort", "900",
> "ORBInitRef"] orb = CORBA.ORB_init(javaParams, CORBA.ORB_ID) obj =
> orb.resolve_initial_references("NameService")
>
> However, that throws: omniORB.NO_RESOURCES_InitialRefNotFound. I checked
> open ports and as the documentation for orbd says, 900 and 1049 are being
> listened by orbd. So I added the info about hte
> InitRef:
>
> javaParams = ["ORBInitialHost", "localhost", "ORBInitialPort", "900",
> "ORBInitRef", "NameService=corbaname::localhost:1049"]
>
> and it still gives me the same error.
>
> I also tried 'orbd -ORBInitialPort 2809" - with the same results, Java
> client connects, python throws InitialRefNotFound.
>
> Thanks for help!
> Jakub
>
>
> On Wed, Feb 11, 2009 at 10:18 AM, Duncan Grisby <duncan at grisby.org> wrote:
>> On Wednesday 11 February, Jakub Moskal wrote:
>>
>>> I wrote a server in Java and clients in Java and Python. Clients
>>> connect and invoke methods without any problem when the object
>>> reference is retrieved from a string. When I use 'orbd' and
>>> NameService only the Java client connects, the python clients fails
>>> with "omniORB.TRANSIENT_ConnectFailed". I init the ORB in python with
>>> parameters " ["-ORBInitRef", "NameService=corbaname::localhost:900"]
>>> ". What is the port on which 'orbd' runs its NameService? I tried
>>> some other ports but all gave me the same error.
>>
>> Java's orbd doesn't support the interoperable naming service, so you
>> can't use a corbaname URI to resolve it. The Java ORB uses a
>> proprietary bootstrap mechanism invented by Sun. Luckily for you,
>> omniORB supports it too. It should work if you use these arguments
>> instead of the
>> -ORBInitRef:
>>
>> -ORBInitialHost localhost -ORBInitialPort 900
>>
>>
>>> My second question has to do with creating new objects. I wrote an
>>> object factory on client that returns new objects which implement my
>>> interfaces, e.g.
>>
>> Everything you've done looks fine, so I don't know why you'd be
>> getting such a strange problem. It's definitely nothing to do with the
>> omniORB end, though.
>>
>> Cheers,
>>
>> Duncan.
>>
>> --
>> -- Duncan Grisby --
>> -- duncan at grisby.org --
>> -- http://www.grisby.org --
>>
>
> _______________________________________________
> omniORB-list mailing list
> omniORB-list at omniorb-support.com
> http://www.omniorb-support.com/mailman/listinfo/omniorb-list
>
>
More information about the omniORB-list
mailing list