CosNaming_BindingIterator:destroy/1 errors

Niclas Eklund nick@REDACTED
Sat Jan 7 17:27:27 CET 2006


Hello Lonnie!

When you invoke the list operation requesting a list containing a list
exceeding the number of existing entries, then the returned iterator will
be a nil object reference. In this case you asked for 25, but only 4
existed. This is the reason why you got the INV_OBJREF exception. To avoid
this you can use the corba_object:is_nil/1 operation to see if it's a
valid reference (i.e. posible to invoke
'CosNaming_BindingIterator':destroy(BIterator)) or check the number of
returned elements.
IMHO, this is the common behavior amongst CosNaming implementations.

/Niclas

On Fri, 6 Jan 2006, Lonnie Smith wrote:
> Hi -
> 
> I'm trying to clean up my BindingIterators after a call to
> 'CosNaming_NamingContext':list/2, but getting some errors:
> 
> >  NS = corba:resolve_initial_references("NameService").
> {'IOP_IOR',"IDL:omg.org/CosNaming/NamingContext:1.0",
>            [{'IOP_TaggedProfile',0,
>                                  {'IIOP_ProfileBody_1_0',
>                                      {'IIOP_Version',1,0},
>                                      "vbox",
>                                      21012,
>                                      "NameService"}}]}
> > {ok, BList, BIterator} = 'CosNaming_NamingContext':list(NS, 25).
> {ok,[{'CosNaming_Binding',[{'CosNaming_NameComponent',"road",[]}],ncontext},
>      {'CosNaming_Binding',[{'CosNaming_NameComponent',"trail",[]}],ncontext},
>      {'CosNaming_Binding',[{'CosNaming_NameComponent',"helper","Object"}],
>                           nobject}],
>     {'IOP_IOR',[],[]}}
> > 'CosNaming_BindingIterator':destroy(BIterator).
> 
> =ERROR REPORT==== 6-Jan-2006::13:28:20 ===
> Error in process <0.30.0> with exit value:
> {{nocatch,{'EXCEPTION',{'INV_OBJREF',[],16#45520000,'COMPLETED_NO'}}},[{corba,raise,1},{erl_eval,do_apply,5},{shell,exprs,6},{shell,eval_loop,3}]}
> 
> ** exited:
> {{nocatch,{'EXCEPTION',{'INV_OBJREF',[],1163001856,'COMPLETED_NO'}}},
>             [{corba,raise,1},
>              {erl_eval,do_apply,5},
>              {shell,exprs,6},
>              {shell,eval_loop,3}]} **
> 
> 
> It looks similar to the last problem I had with
> resolve_initial_services/1, where I had the call wrong. But I checked
> the man page for CosNaming_BindingIterator, and it does have a method,
> destroy/1. I also checked the sources and there is a destroy/1 and a
> destroy/2. So what am I doing wrong?
> 
> Lonnie
> -- 
>   Lonnie Smith
>   lonnie_smith@REDACTED
> 
> -- 
> http://www.fastmail.fm - IMAP accessible web-mail
> 

_________________________________________________________________
We Are The ORBs. Resistance Is Futile. Prepare To Be Assimilated!
_________________________________________________________________




More information about the erlang-questions mailing list