[omniORB] How to recover from "A servant has been deleted tha t is still act ivated"

Mark Johnson mark.johnson@onfiber.com
Wed, 22 Aug 2001 18:33:24 -0500


I think I found my problem, it was passing the ORB_ptr twice (???), when I
collapse Initialize() down into server() my problem went away. The problem I
think is that I passed initially a reference to Initialize() and then a
pointer to BindObjectToName().  I was confused about how to pass around the
ORB_var ...

CORBA::Boolean BindObjectToName( CORBA::ORB_ptr aOrb
                                  , CORBA::Object_ptr aObjRef
                                  , std::string & aErrMsg )
{
	<...snip..>      
	CORBA::Object_var obj;
	// this is the line throwing the exception...
	obj = aOrb->resolve_initial_references( NAMESERVICE );
	<...snip..>
}
int Initialize( CORBA::ORB_var & aOrb
                 , Echo_i * aServant
                 , std::string & aErrMsg ) 
{
	<...snip..>      

 	CORBA::Object_var nameServer;
	nameServer = aOrb->resolve_initial_references( ROOT );

	<...snip...>
 	if( !BindObjectToName(aOrb, obj, aErrMsg) )
 	{
 		aErrMsg += "\nfailed to bind object to name.";		
 		return 0;
 	}
 	<...snip...>
      return 1;
}
int server( int argc, char * argv[] )
{
    <...snip...>
 	CORBA::ORB_var orb = CORBA::ORB_init( argc, argv, "omniORB3" );
	Initialize( orb, echo, errmsg );
    <...snip..>
    return 0;
 }
 
> > -----Original Message-----
> > From: Duncan Grisby [mailto:dgrisby@uk.research.att.com]
> > Sent: Wednesday, August 22, 2001 11:19 AM
> > To: Mark Johnson
> > Cc: OmniOrb Mailing List (E-mail)
> > Subject: Re: [omniORB] How to recover from "A servant has 
> been deleted
> > that is still act ivated" 
> > 
> > 
> > On Wednesday 22 August, Mark Johnson wrote:
> > 
> > > I'm new here, day 3 in corba/omniorb-ville.  I checked 
> > through the archives
> > > and found out that the reason I got this error, "A servant 
> > has been deleted
> > > that is still activated", is because I accidently ran the 
> > "echo" example
> > > server twice.
> > 
> > Precisely what happened?  Please explain what emitted the 
> error, what
> > version of omniORB you are using, and what your platform 
> and compiler
> > is.
> > 
> > It is no problem to start more than one echo server (I 
> assume you mean
> > eg3_impl). The most recently started one over-writes the 
> name service
> > entries for any earlier ones, exactly as it should. If you 
> are seeing
> > a failure in doing this, something somewhere is broken.
> > 
> > Cheers,
> > 
> > Duncan.
> > 
> > -- 
> >  -- Duncan Grisby  \  Research Engineer  --
> >   -- AT&T Laboratories Cambridge          --
> >    -- http://www.uk.research.att.com/~dpg1 --
> > 
>