[omniORB] exception in generated code

Morris, Steve (SW/FW - Rehovot) morris at hp.com
Thu Jan 3 14:33:11 GMT 2008


I am getting the following exception in the code generated by omniidl.

Traceback (most recent call last):
  File "C:\projects\JobPreview\JobPreviewFrame.py", line 450, in connectToIPC
    ref = registry.find("iPC_CONNECT")
  File "C:\projects\JobPreview\registry_idl.py", line 94, in find
    return _omnipy.invoke(self, "find", _0_hp.orblite.RegistryPackage.Registry._d_find, args)
  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)

Here is a code snippet taken from JobPreviewFrame.py that shows the problem:

orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
obj = orb.string_to_object(ior)
registry = obj._narrow(Registry)     # the narrow works
ref = registry.find("iPC_CONNECT")   # this call raises the TypeError

Registry is a naming service and find() returns a reference to a registered interface "iPC_CONNECT".

Here is the code in iPC_Connect.idl

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

Here is the code in iPC_ PropertyManager.idl

module iPC_API {
  interface PropertyManager
  {
    boolean get(in boolean property);
  };
};

Any ideas?

Steve Morris



More information about the omniORB-list mailing list