[omniORB] upgrade from omniORB280 to omniORB305

Duncan Grisby duncan@grisby.org
Fri Nov 8 15:41:02 2002


On Wednesday 6 November, "Smith, Wayne" wrote:

> I'm attempting to upgrade from omniORB280 to omniORB305. It appears
> as though I'm having difficulty with a macro we use in our baseline
> to compile different ORBs.

I'd strongly recommend upgrading to omniORB 4.0.0 rather than
3.0.5. There seems little point in upgrading from one old version to
another.

> To compile omniORB we use the following macro:
> 
>    #define ACTIVATE_OBJECT(o) (boa->obj_is_ready(o), o->_this())
> 
> Each file that contains this macro dies similarly on o->_this.
> The first of which is eventSupplier.C
> The class definition is in eventSupplier.h:
> 
>   class EventSupplier
>       : public virtual CosEventComm::_objref_PushSupplier

As Gary pointed out, you should not inherit from _objref_PushSupplier.
That is a private internal class. If you want to keep using the BOA,
you should keep using _sk_PushSupplier as you did with omniORB 2.8.
Otherwise, use POA_CosEventComm::PushSupplier.

> In eventSupplier constructor is where the compilation dies:
> 
>   EventSupplier::EventSupplier(const char *name, const char *userid)
>       : CosEventComm::PushSupplier
>   {
>     char channel_name[256];
>     utlExpandEnvironment(channel_name, name);
>     char event_name[256];
>     sprintf(event_name, "%s_%s", channel_name, userid);
> 
>     CosEventChannelAdmin::EventChannel_var eventChannel;
>     eventChannel = createChannel(event_name);
> 
>     CORBA::BOA_ptr boa = _boa();
> 
>     ACTIVATE_OBJECT(eventChannel);

You are mixing up object references and servants. omniORB 2.x allowed
you to do that to some extent, but newer ORBs do not. Your
implementation object is a servant. You cannot use it where an object
reference is expected. You must activate the servant object with
boa->impl_is_ready, then get a suitable object reference with the
return value of _this().

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan@grisby.org     --
   -- http://www.grisby.org --