help with CosNaming

Niclas Eklund nick@REDACTED
Tue Nov 13 15:13:19 CET 2001


Hello!

The most probable reason why it fails is that the two Orber-ORB's use the
same domain-name (default it is "ORBER"). Easily checked by invoking on
both ORB's:

erl> orber:info().


Hopefully you are using the latest ORB (at least a R7B-ORB). If so you
should use the Interoperable Name Service, especially since it's
compatible with other ORB's supporting the same standard (see '9.1.5
Writing a Client in Java' and '7.3 Interoperable Naming Service' in the
Orber User's Guide).

A few examples, let's start with accessing objects directly from the
NameService:

"Full version":
corba:string_to_object("corbaname:iiop:1.2@REDACTED:4001/NameService#StackFactory").

"Short hand":
corba:string_to_object("corbaname::tiger:4001/#StackFactory").
Default is iiop-protocol, IIOP-1.0 and "NameService". But, to be on the
safe side I guess it's better to use the full version.

If you want to access the local NameService you can write:
corba:string_to_object("corbaname:rir:/NameService#StackFactory").

Naturally you can supply a longer path (assuming that the 'kind'-field in 
the NameComponent == ""; see '7.3.3 corbaname' in the User's Guide):

corba:string_to_object("corbaname::tiger:4001/#org/erlang/StackFactory").

You can also just lookup the NameService reference:

corba:string_to_object("corbaloc:iiop:1.2@REDACTED:4001/NameService").

Currently Orber only allows "NameService" as key.

See also CosNaming_NamingContextExt in the reference manual.

Also explore the features which the configuration parameters 'orbInitRef'
and 'orbDefaultInitRef' supplies ('5.2 Configuration' in the User's
Guide).

/Nick



On Tue, 13 Nov 2001, Chandrashekhar Mullaparthi wrote:
> I'm experimenting with Orber/CORBA and need some help with the NameService.
> 
> I've compiled the example and run it successfully. Now I'm trying to run the
> stack_client from another erlang node. This is where the problems begin.
> 
> 1> NS = corba:resolve_initial_references_remote("NameService",
> ["iiop://tiger:4001"]).
> 
> works fine, though from a Windows client this call crashes the very first
> time and then works fine after that.
> 
> 2> 'CosNaming_NamingContext':list(NS, 10).
> returns
> {ok, [], BindingIterator}.
> 
> But if I execute the same command on the node where the orb is running, I
> get
> 5>
> {ok,[{'CosNaming_Binding',[{'CosNaming_NameComponent',"StackFactory",[]}],
>                           nobject}], BindingIterator}.
> 
> The documentation for CosNaming_NamingContext:bind/3 says:
> 
> "Creates a binding of a name and an object in the naming context. Naming
> contexts that are bound using bind() do not participate in name resolution."
> 
> I don't understand this. How does one bind a name to an object which can be
> resolved? Can someone please give me a version of the stack example which
> will work across nodes??
> 
> cheers,
> Chandru





More information about the erlang-questions mailing list