[omniORB] _narrow problems with VAC++ 5.0 on AIX
Peter Ledbrook
p.ledbrook@psenterprise.com
Fri, 28 Jul 2000 12:12:14 +0100
Hi,
Much as I would like to give up supporting AIX, we are not allowed to.
So, can anyone help with this problem.
Part of an interface structure I have is:
ICapeNumericSolverComponent
ICapeNumericLAComponent : ICapeNumericSolverComponent
ICapeNumericLASystemFactory : ICapeNumericLAComponent
Now, the client gets an object reference from a shared library that it
loads in. This object reference is an implementation of the
ICapeNumericLASystemFactory interface and has a repoID of:
"IDL:ICapeNumericLASystemFactory:1.0"
The client then tries to narrow this to an
ICapeNumericSolverComponent_ptr with a repoID of:
"IDL:ICapeNumericSolverComponent:1.0"
This narrow fails though, and returns a _nil object reference. Stepping
through the code of _realNarrow I see the following behaviour:
void*
omniObject::_realNarrow(const char* repoId)
{
void* target = _widenFromTheMostDerivedIntf(repoId); <<<<< This
returns 0x00000000
if (target) {
// Must increment the reference count because the return value
// will be freed by CORBA::release().
omni::objectDuplicate(this);
}
else {
if (is_proxy()) { <<<<< This fails, so drops out of this if
block
// Either:
// 1. This proxy object was created for an object type that we do
not
// have authoritative answer to its inheritance relation.
// 2. The object's actual most derived type has been changed to a
// more derived type after this object reference is generated.
// Since the type ID in the IOR is only considered as a hint,
// we cannot give up without asking the object about it.
// Use _is_a() to query the object to find out if <repoId> is the
// IR repositoryID of a base type of this object.
if (_real_is_a(repoId)) {
// OK, it is a base type
try {
omniObject* omniobj = omni::createObjRef(NP_IRRepositoryId(),
repoId,
iopProfiles(),0);
target = omniobj->_widenFromTheMostDerivedIntf(repoId);
}
catch(...) {}
}
}
}
return target; <<<<< Returns 0x00000000
}
This only happens on AIX and I have no idea why. I'm not particularly au
fait with the mechanism for checking the inheritance hierarchy, so has
anyone else come across this or know a solution? This seems to be the
cause of a bug in our software which stops it working at all :-/
As usual, any help would be much appreciated,
Peter
--
Product Development Engineer
Process Systems Enterprise Ltd.
Bridge Studios,
107a Hammersmith Bridge Road,
London
W6 9DA
Tel: +44 20 8563 0888 Fax: +44 20 8563 0999
mailto:p.ledbrook@psenterprise.com
website: http://www.psenterprise.com