[omniORB] Python proxy type returned on Win2k
Duncan Grisby
dgrisby@uk.research.att.com
Fri, 22 Feb 2002 11:48:21 +0000
On Friday 22 February, Lars von Wedel wrote:
> I have changed from NT4 to W2k on my machine and encountered the
> following behavior using Python 2.1.2, omniORB 3.04, omniORBpy 1.4
> binaries for Windows: Although I imported CosNaming
> resolve_initial_references is now giving me a CORBA.Object proxy
> that I have to _narrow to a CosNaming.NamingContext first. Otherwise
> I receive an error about a non-existing method.
>
> The same program worked fine under NT4. It's not a real problem,
> just a question of an additional narrow, but I'd like to know
> whether it's intended behavior?
As explained in section 3.1 of the omniORBpy manual, you should
_always_ narrow the result of an operation that is declared in IDL as
returning base CORBA::Object, since there are plenty of cases where it
is impossible for the ORB to know the type of an object.
In this case, I suspect the reason it worked before was that you had
configured the omniNames location using an IOR, or with ORBInitialHost
/ ORBInitialPort, which meant that the full type id for the object was
available to omniORBpy when it created the object reference. In the
new installation, I suspect you use corbaloc or corbaname, which means
omniORBpy doesn't know anything about the object's type. You have to
use narrow to tell it.
Cheers,
Duncan.
--
-- Duncan Grisby \ Research Engineer --
-- AT&T Laboratories Cambridge --
-- http://www.uk.research.att.com/~dpg1 --