[omniORB] omniORBpy: Need some help
Duncan Grisby
dgrisby@uk.research.att.com
Mon, 04 Sep 2000 12:29:31 +0100
On Sunday 3 September, Detlev Offenbach wrote:
> I am fairly new to Corba and am playing around with omniORBpy. I
> code a little bank application. However I get the following
> stacktrace when executing the call to KontenServerImpl.getKonto.
> omniORB.CORBA.BAD_PARAM: Minor: 0, Completed: COMPLETED_MAYBE.
[...]
> konto = KontoImpl.KontoImpl(whrandom.randint(1, 1000))
> self.konten[inhaber] = konto
>
> return konto
You are trying to return a servant implementation object from an
operation which (presumably) is meant to return a CORBA object
reference. You must activate the servant object in a suitable POA,
either explicitly or implicitly, and return its object reference. For
clarity of code, it is best to explicitly activate your objects. Your
code should be something like:
konto = KontoImpl.KontoImpl(whrandom.randint(1, 1000))
id = poa.activate_object(konto)
konto_obj = poa.id_to_reference(id)
self.konten[inhaber] = konto_obj
return konto_obj
Cheers,
Duncan.
--
-- Duncan Grisby \ Research Engineer --
-- AT&T Laboratories Cambridge --
-- http://www.uk.research.att.com/~dpg1 --