Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about the rmi

 
Jofer Chan
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,everyone:
I use the codes follow:
Client:

Server:

when ip="127.0.0.1",is OK;
when ip="my host name",it throws not found exception.
how to use both ip and hostname for lookup the remote object?
can I use above codes for assignment with Submissions?
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your problem is because you have forced your RMI services to 127.0.0.1.

In fact, you do not need to specify the IP and protocol of RMI registry.
You can do this simply by:

Then, you can connect to the RMI server using both IP and hostname (if you can resolve the hostname by either DNS or network mapping file)
Hope this help.
Nick
[ December 19, 2003: Message edited by: Nicholas Cheung ]
 
Jofer Chan
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,Nicholas :
thank you.
I modify follow:

it registry ok,
but lookup occur exception:
Unknown host: rmi://127.0.0.1:2010; nested exception is:
java.net.UnknownHostException: rmi://127.0.0.1:2010
get me a help.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you have a bit misunderstanding about RMI.
RMI Registry is only used in Server side.
In Client side, if you want to look up the RMI services in your network, you need:

Hope this help.
Nick.
[ December 19, 2003: Message edited by: Nicholas Cheung ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic