[omniORB] omniORBpy Exception exceptions.AttributeError

Duncan Grisby duncan at grisby.org
Wed Apr 29 11:48:27 BST 2009


On Tuesday 28 April, Kyle Dunn wrote:

> Forgot to include the output after running the above:

[...]
>   File "/home/krdunn2/localPrefix/lib/python2.4/site-packages/
> CosNaming_idl.py", line 231, in resolve
>     return _omnipy.invoke(self, "resolve",
> _0_CosNaming.NamingContext._d_resolve, args)
>   File "/tmp/tmplka8PB", line 900, in __init__
>   File "/tmp/tmplka8PB", line 763, in __init__
>   File "/tmp/tmplka8PB", line 590, in __init__
> TypeError: unbound method __init__() must be called with _objref_Entity
> instance as first argument (got _objref_Panorama instance instead)
> Exception exceptions.AttributeError: "_objref_Panorama instance has no
> attribute '_Object__release'" in <bound method _objref_Panorama.__del__ of
> <gri._objref_Panorama instance at 0xb7a074cc>> ignored

Your previous catch-all except block was indeed swallowing the important
error.

The problem is that you are using omniORB.importIDL to import two
separate IDL files, but both those files #import the same file. In that
file, a base interface named "Entity" is defined.

Since importIDL loads each IDL file separately, the definitions from the
second import overwrite the definitions from the first one. That means
you have two separate classes called _objref_Entity, leading to the
error "TypeError: unbound method __init__() must be called with
_objref_Entity instance as first argument (got _objref_Panorama
instance instead)". _objref_Panorama is derived from a different
_objref_Entity than the one that's now present.

There are two ways to fix this. One is to explicitly compile the IDL
with omniidl, rather than doing it dynamically with importIDL(). The
other way is to do a single call to importIDL() (or importIDLString()),
giving it a file with #includes to the two IDL files. That way, all the
classes will be defined at the same time and there won't be any
conflicts.

Cheers,

Duncan.

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



More information about the omniORB-list mailing list