[omniORB] NameService

Eguchi, Koji Koji.Eguchi@DRKW.com
Mon, 15 Apr 2002 22:29:51 +0900


Thanks, and I'm terribly sorry that I said JDK in the initial message. It's
actual the TAO 1.2.2 that I'm developing with.
In the case, how does following code look ?

{
	CORBA::object_var naming_obj =
orb->resolve_initial_references("NameService");
	CosNaming::NamingContext_var root =
CosNaming::NamingContext::_narrow(naming_obj.in());

	CosNaming::Name name(2);
	name.length(2);
	name[0].id = CORBA::string_dup("Stars");
	name[1].id = CORBA::string_dup("MCM");
	CORBA::Object_var obj = root->resolve(name);
}

Than at start-up, I execute like this and it results with
NamingContext/NotFound exception thrown.

>client -ORBInitRef NameService=iioploc://myhost.com:2809/NameService

I guess I'm not sure about the id and kind...

Best regards,
Koji


-----Original Message-----
From: Duncan Grisby [mailto:dgrisby@uk.research.att.com]
Sent: 2002 4 15 22:02
To: Eguchi, Koji
Cc: OmniOrb mailing list (E-mail)
Subject: Re: [omniORB] NameService 


On Monday 15 April, "Eguchi, Koji" wrote:

> Using omniORB 3.0.2 on HP, I'm trying to have my client application
resolve
> for name service expressed as
> "corbaname::myhost.com:2809#Stars.Services/MCM.Server". The problem is I
> have to write this client with JDK to communicate with omniNames and
server
> applications developed with omniORB, and I'm not sure how I must interpret
> the above string. Although I was able to resolve for "NameService"
> successfully, I get NamingContext NotFound exception for subsequent code. 
> If anyone can tell me the string contains the name(s) of service to be
> resolved, please kindly let me know.

JDK 1.4 supports the INS, so it will accept the corbaname string. If
you're using JDK 1.3, you'll have to create the name sequence
yourself. The above string represents a two element naming sequence.
The first element has id "Stars", kind "Services"; the second has id
"MCM", kind "Server".

To get the reference to the naming service itself, you should
configure the Java ORB with either the IOR printed when omniNames
starts up, or using ORBInitialHost/ORBInitialPort.

Note that JDK 1.3 has a bug that means it will crash if omniNames is
running on the same machine as the client. There is no workaround that
I'm aware of.

Cheers,

Duncan.

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


***************************************************************************
Dresdner Kleinwort Wasserstein is the marketing name used 
globally to represent the investment banking activities of 
Dresdner Bank Group. In Japan, Dresdner Kleinwort Wasserstein 
is represented by Dresdner Kleinwort Wasserstein (Japan) Limited,
Tokyo Branch or Dresdner Bank AG, Tokyo Branch.
If you have received this e-mail in error or wish to read our e-mail
disclaimer statement and monitoring policy, please refer to 
http://www.drkw.com/disc/email/ or contact the sender.
***************************************************************************