• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to put rmiregistry in code?

 
Daniel Chen
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote some code for rmiregistry.The following is fragment of my server and client code.


When I run server, it looks normally.But I run client, it throws a java.rmi.NotBoundException: RemoteData.What is the problem in my code?
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Daniel,
I think you should add the protocol to the string as in : rmi://<host_name>;[:<name_service_port /<service_name>.
(Found this at http://developer.java.sun.com/developer/onlineTraining/rmi/RMI.html#IntroRMI)
Cheers
Torgny
 
Daniel Chen
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Torgny,
Thank you.I found the problem.My origin client code is like the following.

I tried to use new client code like that

Then it is ok.But why?Naming and LocateRegistry both implement Registry, what is the diffient?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic