[omniORB] Help passing objects

Jonathan Gallmeier jonathan@arlut.utexas.edu
Fri, 25 Jun 1999 17:18:54 -0500


Hi,

I'm new to CORBA and omniORB, so pardon me if this is really basic.

So far I am able to pass the basic data types from interface methods,
but
I always get an exception caught when I try to pass an interface object
from
a server to a client. 

I have an idl file with something like

interface  Something
{
   readonly attribute Name;
};

interface Broker
{
  Something CreateSomething(in String name);
};

Then I derive the classes and implement these interfaces. The problem
appears to happen in returning the object in CreateSomething... The
method looks like this:

Something_ptr
Broker_impl::CreateSomething(const char * name)
{
  Something_impl *person = new Something_impl(name);

  return Something::_duplicate(person);
}

It appears that the _duplicate(person) causes an exception.
The server creates a broker object, the client uses the broker object
to call CreateSomething and get back a Something object to do more work
(get the name, etc.)

What am I doing wrong here? this approach was given in the book
"Corba for dummies", which uses Orbix. Since I am really new to this,
could one of you out there point me in the right direction? 

Jonathan
jonathan@arlut.utexas.edu

-- 

-------------------------------------------------------------------------------
Jonathan Gallmeier                | We act a though comfort and luxury
were 
email : jonathan@arlut.utexas.edu | chief ingredients of happiness, when
all
office: (512) 835-3812            | we really wanted was something to be 
FAX   : (512) 835-3808            | excited about. - Anonymous
-------------------------------------------------------------------------------