Andreas Motl
2007-07-01 00:28:34 UTC
Hi there,
we are using omniORB4 and omniORBpy3 (client-side) together with Java1.5
ORB/org.omg.CORBA (server-side) for an exercise project at university.
Everything worked out well, but today we ran into some issues.
What already works without any problems:
- Obtaining object refs published by the Java side via omniNames (main API)
- Using object refs from objects created at the Python side and passed
as method arguments to the Java side (callback mechanism)
Today we tried to pass object refs created at the Java side to Python
which gives us a strange error when trying to invoke methods on these refs:
omniORB.CORBA.INV_OBJREF:
CORBA.INV_OBJREF(omniORB.INV_OBJREF_InterfaceMisMatch, CORBA.COMPLETED_NO)
I've annotated and attached the relevant parts of the trace from the
Python side.
Can you give us some hints on what we are doing wrong? Many thanks in
advance!
cheers, andi.
-------------- next part --------------
-----------------------------------------------------
A. obtaining initial object refs via name service
-----------------------------------------------------
omniORB: LocateRequest to remote: key<NameService>
omniORB: Creating Python ref to remote: key<............................RootPOA..............>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id: IDL:Editor/CoreApi:1.0
omniORB: Creating Python ref to remote: key<............................RootPOA..............>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id: IDL:Editor/GuiApi:1.0
omniORB: Creating Python ref to remote: key<............................RootPOA..............>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id: IDL:Editor/ContentApi:1.0
omniORB: ObjRef() -- deleted.
These are the three parts of our API at the Java side obtained via name service lookup.
Calling methods on these is no problem.
-----------------------------------------------------
B. narrowing object ref returned by method call
-----------------------------------------------------
omniORB: LocateRequest to remote: key<............................RootPOA..............>
omniORB: Client attempt to connect to giop:tcp:192.168.178.21:4540
omniORB: Client opened connection to giop:tcp:192.168.178.21:4540
Registered plugin at host: True
omniORB: LocateRequest to remote: key<............................RootPOA..............>
omniORB: Creating Python ref to remote: key<............................RootPOA..............>
target id : IDL:Editor/Testing:1.0
most derived id: IDL:Editor/Testing:1.0
This is the result after calling an api method which returns an object ref. This object
ref gets properly narrowed:
mytest = self.editor_gui.test1("hello")
t = mytest._narrow(Editor.Testing)
print t gives us....
<Editor._objref_Testing instance at 0x00C5FFA8>
print t.abc (abc is an example method of t) gives us...
<bound method _objref_Testing.abc of <Editor._objref_Testing instance at 0x00C5FFA8>>
So everything seems to be fine!?
-----------------------------------------------------
C. the error
-----------------------------------------------------
When actually invoking ....
print t.abc("huhu")
... the exception gets raised:
omniORB: omniORB: The object with the IR repository ID: IDL:Editor/Testing:1.0
returns FALSE to the query _is_a("IDL:Editor/Testing:1.0").
A CORBA::INV_OBJREF is raised.
omniORB: throw INV_OBJREF from omniObjRef.cc:407 (NO,INV_OBJREF_InterfaceMisMatch)
Traceback (most recent call last):
File "./guitest.py", line 114, in ?
main()
File "./guitest.py", line 109, in main
p.do_tests()
File "./guitest.py", line 96, in do_tests
self.do_x()
File "./guitest.py", line 90, in do_x
print t.abc("huhu")
File "c:\home\amo\Studium\Material Semester 4\Middleware\Code\trunk\src\plugins\python\editor_idl.py", line 500, in abc
return _omnipy.invoke(self, "abc", _0_Editor.Testing._d_abc, args)
omniORB.CORBA.INV_OBJREF: CORBA.INV_OBJREF(omniORB.INV_OBJREF_InterfaceMisMatch, CORBA.COMPLETED_NO)
-----------------------------------------------------
D. comments
-----------------------------------------------------
1. The method call is done with the right signature, otherwise (e.g.) a "TypeError: Operation requires 1 argument; 0 given"
would have been raised.
2. The message ...
The object with the IR repository ID: IDL:Editor/Testing:1.0 returns FALSE to the query _is_a("IDL:Editor/Testing:1.0")
...is rather puzzling to me. Aren't apples apples?
we are using omniORB4 and omniORBpy3 (client-side) together with Java1.5
ORB/org.omg.CORBA (server-side) for an exercise project at university.
Everything worked out well, but today we ran into some issues.
What already works without any problems:
- Obtaining object refs published by the Java side via omniNames (main API)
- Using object refs from objects created at the Python side and passed
as method arguments to the Java side (callback mechanism)
Today we tried to pass object refs created at the Java side to Python
which gives us a strange error when trying to invoke methods on these refs:
omniORB.CORBA.INV_OBJREF:
CORBA.INV_OBJREF(omniORB.INV_OBJREF_InterfaceMisMatch, CORBA.COMPLETED_NO)
I've annotated and attached the relevant parts of the trace from the
Python side.
Can you give us some hints on what we are doing wrong? Many thanks in
advance!
cheers, andi.
-------------- next part --------------
-----------------------------------------------------
A. obtaining initial object refs via name service
-----------------------------------------------------
omniORB: LocateRequest to remote: key<NameService>
omniORB: Creating Python ref to remote: key<............................RootPOA..............>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id: IDL:Editor/CoreApi:1.0
omniORB: Creating Python ref to remote: key<............................RootPOA..............>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id: IDL:Editor/GuiApi:1.0
omniORB: Creating Python ref to remote: key<............................RootPOA..............>
target id : IDL:omg.org/CORBA/Object:1.0
most derived id: IDL:Editor/ContentApi:1.0
omniORB: ObjRef() -- deleted.
These are the three parts of our API at the Java side obtained via name service lookup.
Calling methods on these is no problem.
-----------------------------------------------------
B. narrowing object ref returned by method call
-----------------------------------------------------
omniORB: LocateRequest to remote: key<............................RootPOA..............>
omniORB: Client attempt to connect to giop:tcp:192.168.178.21:4540
omniORB: Client opened connection to giop:tcp:192.168.178.21:4540
Registered plugin at host: True
omniORB: LocateRequest to remote: key<............................RootPOA..............>
omniORB: Creating Python ref to remote: key<............................RootPOA..............>
target id : IDL:Editor/Testing:1.0
most derived id: IDL:Editor/Testing:1.0
This is the result after calling an api method which returns an object ref. This object
ref gets properly narrowed:
mytest = self.editor_gui.test1("hello")
t = mytest._narrow(Editor.Testing)
print t gives us....
<Editor._objref_Testing instance at 0x00C5FFA8>
print t.abc (abc is an example method of t) gives us...
<bound method _objref_Testing.abc of <Editor._objref_Testing instance at 0x00C5FFA8>>
So everything seems to be fine!?
-----------------------------------------------------
C. the error
-----------------------------------------------------
When actually invoking ....
print t.abc("huhu")
... the exception gets raised:
omniORB: omniORB: The object with the IR repository ID: IDL:Editor/Testing:1.0
returns FALSE to the query _is_a("IDL:Editor/Testing:1.0").
A CORBA::INV_OBJREF is raised.
omniORB: throw INV_OBJREF from omniObjRef.cc:407 (NO,INV_OBJREF_InterfaceMisMatch)
Traceback (most recent call last):
File "./guitest.py", line 114, in ?
main()
File "./guitest.py", line 109, in main
p.do_tests()
File "./guitest.py", line 96, in do_tests
self.do_x()
File "./guitest.py", line 90, in do_x
print t.abc("huhu")
File "c:\home\amo\Studium\Material Semester 4\Middleware\Code\trunk\src\plugins\python\editor_idl.py", line 500, in abc
return _omnipy.invoke(self, "abc", _0_Editor.Testing._d_abc, args)
omniORB.CORBA.INV_OBJREF: CORBA.INV_OBJREF(omniORB.INV_OBJREF_InterfaceMisMatch, CORBA.COMPLETED_NO)
-----------------------------------------------------
D. comments
-----------------------------------------------------
1. The method call is done with the right signature, otherwise (e.g.) a "TypeError: Operation requires 1 argument; 0 given"
would have been raised.
2. The message ...
The object with the IR repository ID: IDL:Editor/Testing:1.0 returns FALSE to the query _is_a("IDL:Editor/Testing:1.0")
...is rather puzzling to me. Aren't apples apples?