[omniORB] Problems trying to user the Trader service

Sonal Agrawal soagrawa@genuity.com
Fri, 7 Sep 2001 11:01:50 -0400



Hongbin,

This is a comment from one of the senior development Architects from
Omniorb.  The omniORB we use says it is only compatible with Orbix 2.2
according to some obscure documents I found online.  Perhaps Nortel was
using an older version of Orbix with INM V5.  I am currently working on
changing the code to Orbix.

Sonal

> -----Original Message-----
> From: owner-omniorb-list@uk.research.att.com
> [mailto:owner-omniorb-list@uk.research.att.com]On Behalf Of Sai-Lai Lo
> Sent: Friday, September 07, 2001 5:24 AM
> To: Sonal Agrawal
> Cc: omniorb list
> Subject: Re: [omniORB] Problems trying to user the Trader service
>
>
> I guess you trader is running on top of Orbix. Older versions of
> Orbix fails
> to response correctly to a _is_a invocation. The call is used
> internally in
> omniORB to ensure the object reference is of the correct type in _narrow.
> I'm afraid there is nothing you can do in omniORB to get around this
> problem.
>
> Sai-Lai
>
>
> ----- Original Message -----
> From: "Sonal Agrawal" <soagrawa@genuity.com>
> To: <omniorb-list@uk.research.att.com>
> Sent: Tuesday, September 04, 2001 9:26 PM
> Subject: [omniORB] Problems trying to user the Trader service
>
>
> >
> > Hello,
> >
> > I am trying to use the Trader service to get certain Factory agent
> objects.
> > I do get a valid traderLookupPtr however, I get an invalid ptr returned
> from
> > CosTrading::Lookup::_narrow(traderLookupRef) when I narrow it.  Hence, I
> get
> > an exception later when I do a traderLookupPtr->query(....).
> >
> > I am attaching the snipet of code below.  The traderLookupPtr is defined
> as:
> > CosTrading::Lookup_ptr traderLookupPtr;  in the header file.  I
> am able to
> > succesfully execute a sample client written with Orbix by the vendor but
> not
> > this code using OmniOrb.   Do I need to set omniORB in a certain way?
> > Please could someone help.
> >
> > Thanks,
> >
> > Sonal Agrawal
> >
> >
> >
> >   const char *traderIorPathname = "./TRADER_IOR";
> >   FILE *traderIorFileHandle;
> >   CORBA::String_var traderIor = CORBA::string_alloc(2048);
> >   CORBA::Object_ptr traderLookupRef = 0;
> >
> >   cout << "Getting 'TradingService' reference...";
> >
> >   // Read the file to get the trader IOR
> >   traderIorFileHandle=fopen(traderIorPathname, "r");
> >   fgets(traderIor,2048, traderIorFileHandle);
> >   fclose(traderIorFileHandle);
> >
> >   traderLookupRef = orb->string_to_object(traderIor);
> >   if (CORBA::is_nil(traderLookupRef))
> >   {
> >     cout << "failed to get trader Ref!" << endl;
> >         exit(-1);
> >   }
> >   else
> >   {
> >     traderLookupPtr = CosTrading::Lookup::_narrow(traderLookupRef);
> >     cout << "done!" << endl;
> >   }
> >
> >
> >  if (CORBA::is_nil(traderLookupPtr))
> >   {
> >     cout << "failed to get trader Ptr!" << endl;
> >         exit(-1);   // ************ programs exits here
> >   }
> >   else
> >   {
> >     cout << "done!  Ready to use the Trader" << endl;
> >   }
> >
> >
> >
>