Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Naming Service: InvalidName Exception

Status
Not open for further replies.

amolpallod

Programmer
Jan 31, 2002
1
0
0
US
Naming Service:
I am using visibroker for java and i am working with the naming service right now. I have implemented a simple time-date example. After compiling the code, I started osagent and then the Naming Service with the command 'nameserv'.
In the server code I have used the method:
orb.resolve_initial_references("NameService") to get the intial naming context.
But a run time exception is raised which is shown below :
org.omg.CORBA.ORBPackage.InvalidName
at com.inprise.vbroker.orb.ORB.resolve_initial_references(ORB.java:712)
at GoodDayServer.main(GoodDayServer.java:39)

Can anyone tell me why this is happening. I feel that I have done this as it is said in the Naming Service documentation of Visibroker.
Any help will be of great help.
Thank you
Amol
 
I have had the same problem I think. The only way I found to get round this to do the following

final Properties props = new Properties();
.
.
props.setProperty("ORBInitRef","NameService=IOR:000.....");
.
.
orb = ORB.init(args, properties);
.
.
obj = orb.resolve_initial_references("NameService");
.
etc...
When you start the Name Service it creates a file ns.ior in your profile directory which contains the IOR. You can open this file and read it at run-time or hard code the value. Every other approach I've tried gives the InvalidName exception you describe.

You could probably use vbj -DORBInitRef=Nameservice=IOR:000.... etc but I haven't tried this.

hope this helps!
 
Has anyone else run into this, and is the recommended solution the only way around it? It would be very unfortunate if this was the case...
 
We do use naming services and do not have this issue, please send your complete source code and I will try to help.

Thanks,
Val.
val.gamerman@vicins.com
 
Hya all,

Amol, hope you solved your naming service problem. Indeed, I'm experiencing the same problem under visibroker for C++.
Then, I won't mind any help on it ;).. thanks

By the way if anyone else has the solution to that kind of exception, i'll be happy to hear from you too.
I'm pretty sure it's either a problem when initialazing the ORB or launching the Naming Service (lack of parameters with nameserv.exe)

Many thanks
manekineko
 
You must define the ORBInitRef, but it is not the simplest way. You can define it so:

Properties props = new Properties();
props.setProperty(&quot;ORBInitRef&quot;,&quot;NameService=corbaname::<hostName>:<Naming Service Port>/&quot;);
orb = ORB.init(args, props);
obj = orb.resolve_initial_references(&quot;NameService&quot;);
.
etc...

<serverName> is the host where runs the server and the port is the port of the naming service.

You can also define ORBInitRef as a client parameter:

clientApplication -ORBInitRef NameService=corbaname::<hostName>:<Naming Service Port>/

 
Hello,

I just got the same error and I have solved it in the following way.

vbj -DSVCnameroot=NameService <client name>

where client name is the name of the client you are launching. NameService is the default name for the visibroker name service. If you have more than one running you can use the option above to specify the particular one you want to bootstrap into

s3rp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top