[omniORB] Getting Exception when accessing IFR of Orbix 2.3from omniORB2_2.8pre2

Dejan Polomcic Dejan.Polomcic@telecom.co.nz
Tue, 07 Sep 1999 11:14:52 +1200


A correction
The config file modified is omniORB.cfg not orbix.cfg as mentioned below
.... !!!! sorry for the mistake !!!

thanks 
senthil

>>> "Dejan Polomcic" <Dejan.Polomcic@telecom.co.nz> 7/September/1999
11:04am >>>
Hi omniOrbers,

Getting an unknown Exception when trying to access IFR(Interface
Repository)  of Orbix 2.3 MT

I have added an entry in orbix.cfg for accessing IFR of Orbix 2.3 as
follows:

INTERFACE_REPOSITORY 
IOR:000100000000001649444c3a49545f5265706f7369746f72793a312e3000523a00000001000000000000004c0001000000000006686e323436002d59000000383a5c686e3234363a4946523a49444c5c3a696f6e612e636f6d2f5265706f7369746f72793a3a4946523a49545f5265706f7369746f727900


The catior of the above IOR is as follows:
Type ID: "IDL:IT_Repository:1.0"
Profiles:
1. IIOP 1.0 hn246 11609
":\hn246:IFR:IDL\:iona.com/Repository::IFR:IT_Repository."


Here is the Client Program which throws an Unknown Exception when it
tries to narrow the Repository pointer:

#include <iostream.h>
#define ENABLE_CLIENT_IR_SUPPORT
#include <omniORB2/CORBA.h>
#include <omniORB2/ir_defs.hh>



int
main (int argc, char **argv)
{
  CORBA::ORB_ptr orb =         CORBA::ORB_init(argc,argv,"omniORB2");
  CORBA::BOA_ptr boa = orb->BOA_init(argc,argv,"omniORB2_BOA");
  
        try {
                CORBA::Object_var initServ;
                CORBA::Object_ptr objPtr;
                objPtr =
orb->resolve_initial_references("InterfaceRepository");
                CORBA::String_var p = orb->object_to_string(objPtr);
                cerr << "'" << (char*)p << "'" << endl;
                CORBA::Repository_ptr rVar =
CORBA::Repository::_narrow(objPtr);
                CORBA::ContainedSeq *ifrContents = rVar->contents(
CORBA::dk_all, 1);

                if ( ifrContents->length()  < 1UL )
                {
                        cout << "\n\t- The Interface Repository is
empty.  You must run the following\n";
                        cout << "\t  command in order to populate the
Repository: \n\n";
                        cout << "\t\tputidl BANK.idl\n ";
                        delete ifrContents;
                }
                delete ifrContents;
                //cVar = lookup ("Grid");
                //ifVar = InterfaceDef::_narrow(cVar);
        }
        catch(CORBA::COMM_FAILURE& ex) {
                cerr << "COMM FAILURE: " <<  endl;
        }
        catch(omniORB::fatalException& ex) {
                cerr << "Caught omniORB2 fatalException. This indicates
a bug is caught "
                  << "within omniORB2.\nPlease send a bug report.\n"
                  << "The exception was thrown in file: " << ex.file()
<< "\n"
                  << "                            line: " << ex.line()
<< "\n"
                  << "The error message is: " << ex.errmsg() << endl;
        }
        catch(CORBA::ORB::InvalidName& ex) {
          cerr << "Service required is invalid [does not exist]." <<
endl;
        }
        catch (...) {
                cout << "Binding Failed .... Unknown Exception" << endl;
        }
}

thanks

dejan