omniNames: Interoperability with Orbix
Eoin Carroll
ewc@orl.co.uk
Tue, 14 Oct 1997 16:13:28 +0100 (BST)
Hi,
> I'd like to use omniNames from an Orbix server to implement a bridge
> functionality. So I read the IOR of the root context from the file
> pointed to be env. variable OMNIORB_CONFIG, perform a string_to_object
> and narrow the object to a CosNaming::NamingContext. But when I do so
> the narrowing fails with an exception saying
>
> Unexpected system exception
> 10426-- Error accessing interface repository
> - Cannot bind to Interface Repository
> [Completion status : COMPLETED_NO]
>
> Did anyone try something similar before? Is that a problem of Orbix or
> omniORB? Or is it (what I hope!) just a missusage in my application?
>
> Any help is wellcome.
>
> Regards,
>
> Jan Lessner, C-LAB
>
This is an Orbix bug, affecting Orbix 2.1. It may have been fixed in
Orbix 2.2
Here is what seems to be happening:
The CORBA 2 specification says that identifiers in a Repository ID should
be seperated by '/' characters (section 6.6.1, CORBA v2 Spec). Orbix 2.1
generates IORs containing the correct Repository ID, but, when narrowing
IORs it receives, it expects the identifiers to be seperated by '_'
characters.
This bug only shows up when interoperating with other ORBs, as Orbix first
checks the IOR's object key for the Repository ID information. If the IOR is
generated by Orbix, the object key will contain a Repository ID seperated by
'_' fields, and so it won't fall back to checking the Repository ID
associated with the IOR (which will be seperated by '/' characters).
When an IOR supplied by another ORB is narrowed, it doesn't recognise the
object key, and so falls back to checking the Repository ID associated with
the IOR. It fails to recognise it, (due to the '/' characters), and so
tries to contact the Interface Repository to find out about the interface.
The workaround to this bug is to edited the stubs generated by the Orbix
IDL compiler.
In the case of the Naming Service, edited the generated header file,
Naming.hh. Search for _IMPL, and you will find a preprocessor macro
definition. Change the _ in the string associated with the macro to a /
(e.g. For the macro
#define CosNaming_BindingIterator_IMPL "CosNaming_BindingIterator" ,
change "CosNaming_BindingIterator" to "CosNaming/BindingIterator")
Repeat for all macro definitions ending in _IMPL and also for macro
definitions ending in _IR. Note that there are several definitons of
each macro in the header file - change all of them.
Compile your application, ensuring that the header file that you have
edited is NOT overwritten by the IDL compiler.
hope this helps,
Eoin.
--
Eoin Carroll ewc@orl.co.uk
Research Engineer
Olivetti & Oracle Research Lab
Cambridge, UK