Re: [Orbit-python-list] (in Object obj) marshalling error
Status: Inactive
Brought to you by:
tack
|
From: Christian R. R. <ki...@as...> - 2001-01-23 23:18:08
|
On Tue, 23 Jan 2001, Jason Tackaberry wrote:
> > [...]
> > class Foo:
> > pass
> > a=Foo()
> > nc.bind(a)
> > TypeError: Failed to marshal: Object Reference ()
>
> Like I said earlier, ORBit-Python doesn't handle generic object
> references. However, even if it did, this wouldn't work because Foo
> doesn't inherit a POA class.
You're right. My example was stupid. The problem I have is that ATM you
can't even pass a Corba Object as a parameter -- you get the exact same
error. As a simple example:
module Bar {
interface Foo {
void bind (in Object a);
};
};
and the following servant:
#!/usr/bin/env python
import CORBA
import Bar,Bar__POA
class Foo(Bar__POA.Foo):
def bind(self,i):
print i
o=CORBA.ORB_init([],CORBA.ORB_ID)
p=o.resolve_initial_references("RootPOA")
f=Foo()
f._this()
ref = p.servant_to_reference(f)
print o.object_to_string(ref)
p._get_the_POAManager().activate()
o.run()
produce the same TypeError: Failed to marshal: Object Reference ()
when a client like this tries to call bind:
#!/usr/bin/env python
import sys,CORBA, Bar, Bar__POA
o=CORBA.ORB_init([],CORBA.ORB_ID)
f=o.string_to_object(sys.argv[1])
f.bind(f)
Okay, so I used f as a parameter to itself: it should work, no? And f _is_
a reference to a Corba object.
> I'm not entirely sure what happened here, but my guess is 'a' wasn't a
> valid IOR (such as, for example, if it has trailing newlines and you're
> not using the latest CVS version).
Actually, it was a valid IOR and ior-decode indicated it as such. I'm
using CVS orbit-python (and I check to see if it's been updated daily too
*grin*) But I can't seem to reproduct this right now.
> Well again, ORBit-Python won't handle the objref properly, but in this
> case you're not passing it a CORBA object. It sounds to me like you're
> mixing up the Any type with the Object type.
No, just trying (brokenly) to illustrate that I get the same error message
whether it's a Corba Object or a plain Python object. My example
class Foo:
pass
should really have been
class Foo(Bar__POA.Foo)
pass
but it still doesn't work, regardless :-)
> It's just missing a FIXME :)
> So, here the segfault happens inside object_to_string, not bind().
Ok, this is reasonable, I was just wondering. :-)
Take care,
--
/\/\ Christian Reis, Senior Engineer, Async Open Source, Brazil
~\/~ http://async.com.br/~kiko/ | [+55 16] 274 4311
|