Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Remote Method Invocation Problem  RSS feed

 
DILLIBABU
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a sample piece of coding for RMI.
Interface Coding
================

Class Coding
============

Server Coding
=============

Client Coding
=============

I am getting the output when I use the same machine as Server & Client.
But I am getting error when I used Server & Client in different machines.
Anyone pls solve my problem.
I have tried by changing the Client Coding as
1) HelloInterface hello = (HelloInterface) Naming.lookup("Hello");
-AS-
HelloInterface hello = (HelloInterface) Naming.lookup("http://server ort/Hello");
Error : Invalid Protocol
2) HelloInterface hello = (HelloInterface) Naming.lookup("Hello");
-AS-
HelloInterface hello = (HelloInterface) Naming.lookup("http://serverip ort/Hello");
Error : Invalid Protocol
3) HelloInterface hello = (HelloInterface) Naming.lookup("Hello");
-AS-
HelloInterface hello = (HelloInterface) Naming.lookup("rmi://server ort/Hello");
No result comes
Somebody kindly help.
Babu.
[ September 23, 2003: Message edited by: Michael Ernest ]
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Possibly this old discussion will help you walk through your code and find the problem.
Good luck!
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Welcome to JavaRanch!
The third of your three proposed changes is correct (the rmi:// protocol one). You can omit the port unless you're deliberately running rmiregistry on some non-standard port (in which case, you'd have to modify the server, too.) The stardard port is 1099, so if you're using anything else in your third example, that may be the problem. Just use the hostname, and the program should work.
 
DILLIBABU
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
My problem is solved.
I placed rmi://server/HelloClient
it is working.
Thanks all.
Babu.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"NiceBoy" --
Glad Ernest was able to help you solve the problem.
Now that that's taken care of, please take a moment to review JavaRanch's naming policy. In short, we ask all registered users to provide their name as a condition of using all technical forums.
Please modify your screen name accordingly at your first convenience.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!