[omniORB] exception in generated code

Morris, Steve (SW/FW - Rehovot) morris at hp.com
Sun Jan 6 16:43:18 GMT 2008


You are correct.
Although I had cut my project down to the two IDLs that I listed, that was enough to cause the problem.
iPC_Connect.idl includes iPC_PropertyManager.idl, but I compiled both, with the result that iPC_PropertyManager.idl was included twice in the py files.
When I only compile iPC_Connect.idl the problem disappears.

Thanks very much,
Steve

-----Original Message-----
From: Duncan Grisby [mailto:duncan at grisby.org]
Sent: Sunday, 06 January, 2008 17:45
To: Morris, Steve (SW/FW - Rehovot)
Cc: omniorb-list at omniorb-support.com
Subject: Re: [omniORB] exception in generated code

On Thursday 3 January, "Morris, Steve (SW/FW - Rehovot)" wrote:

[...]
>   File "C:\projects\JobPreview\iPC_Connect_idl.py", line 107, in __init__
>     _0_iPC_API._objref_PropertyManager.__init__(self)
> TypeError: unbound method __init__() must be called with _objref_PropertyManager instance as first argument (got _objref_iPC_Connect instance instead)

[...]
> #include <iPC_PropertyManager.idl>
> module iPC_API {
>   interface iPC_Connect : PropertyManager
>   {
>       boolean testIt( );
>   };
> };
>
> module iPC_API {
>   interface PropertyManager
>   {
>     boolean get(in boolean property);
>   };
> };

Could that interface declaration be included more than once, or is the
interface declared in more than one file?  The generated code that's
failing looks like this

class _objref_iPC_Connect (_0_iPC_API._objref_PropertyManager):
    _NP_RepositoryId = iPC_Connect._NP_RepositoryId

    def __init__(self):
        _0_iPC_API._objref_PropertyManager.__init__(self)

So, on the face of it, the class is definitely correctly derived from
the base class whose __init__ method it's trying to call. The only way
it could fail would be if at some point after that class declaration,
_0_iPC_API._objref_PropertyManager was set to be a different class to
the one that was present at the time the _objref_iPC_Connect class was
declared.

First of all, remove all the generated code and regenerate it, in case
you have something left over from a previous version of the IDL. If that
doesn't help, grep all the _idl.py files looking for duplicate
definitions of the _objref_PropertyManager class.

Cheers,

Duncan.

--
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list