Re: [Orbit-python-list] (in Object obj) marshalling error
Status: Inactive
Brought to you by:
tack
|
From: Roland M. <ma...@ec...> - 2001-01-23 08:37:23
|
Christian Robottom Reis (2001-01-22 22:24:31 -0200) :
> Using orbit-python (no idea if we're getting a Orbit error, however) and a
> simple
>
> interface NamingObject {
> void bind(in Object obj);
> };
>
> interface, I have the following issues:
>
> 1) Calling bind with a simple object reference:
>
> [...]
> class Foo:
> pass
> a=Foo()
> nc.bind(a)
>
> TypeError: Failed to marshal: Object Reference ()
>
> even though a _is_ an object reference.
Hm. Is is a Python object reference, I'm not sure it's a CORBA
object reference.
> 2) Didn't work? Ok, let's try a stringified IOR:
>
> nc.bind(orb.object_to_string(a))
>
> CORBA.SystemException: IDL:CORBA/MARSHAL:1.0: IDL:CORBA/MARSHAL:1.0
>
> Hmm. I wonder why I get a different message?
For the same reason. a is not of a type known by ORBit.
> 3) Let's do something dumb now:
>
> nc.bind(1)
>
> TypeError: Failed to marshal: Object Reference ()
Same again.
You can only marshal objects that are defined in a CORBA interface.
You should add an interface like:
interface Foo {
attribute string bar ;
} ;
Then you need to make your Python Foo class a subclass of
Your_module__POA.Foo:
class Foo (Your_module__POA.Foo):
def __init__ (self):
self.bar = "Initial string"
Only then will ORBit-Python know how to marshal your Foo objects.
> 4) And what about
>
> nc.bind(orb.object_to_string(1))
>
> Segmentation fault
>
> Hmm, boom. Orbit-python or plain Orbit?
That's a tricky question, and a nasty bug anyway. I'll try to have
a look sometime.
> The practical effect of this is that it's impossible to use
> orbit-python with the Orbit nameserver as of now.
I'm not so sure. It's not like I have done it, but I would be more
convinced if you could retry with CORBA objects.
> We simply can't bind the servers to names because bind() takes an
> object parameter.
Yep. A CORBA object, not a Python object.
Roland.
--
Roland Mas
Et c'est tellement plus mignon de se faire traiter de con en chanson...
-- in En chantant (Michel Sardou)
|