my dog learned polymorphism
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI Question, Please HELP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMI Question, Please HELP" Watch "RMI Question, Please HELP" New topic

RMI Question, Please HELP

Alan A Smith

Joined: Apr 25, 2003
Posts: 21
I using RMI as client/server communication. It works fine on rmi default port 1099. The following is my code:


But if I using another port, I get an error in client side: java.rmi.NotBoundException: DBMediator
Is there any things I need to setup if using another port?
Thx a lot
Akshay Sharma
Ranch Hand

Joined: Mar 27, 2003
Posts: 42
You are using port 1099 on the server
and a different port on the client.
The client should look up on the same port as the server.

Akshay Kumar Sharma<br />**********************<br />Good Better Best <br />Never Let it rest<br />For your good is better<br />and the better is the best
Alan A Smith

Joined: Apr 25, 2003
Posts: 21
Sorry, the code I post is some confusing.
I'm testing rmi port on 2048 on both client and server sides.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11778

Hi Alan,
The server is binding to name "DBMediator/" and the client is looking up "DBMediator" - the names are different.
If this is not the problem, then I recommend you repost your code from what you are currently using so we can see exactly what you are doing. Or, create a very simple program that will just test the RMI connectivity. Even something as simple as the following code could be useful to try and get the concept right which you can then translate to your real application.

Regards, Andrew

The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Alan A Smith

Joined: Apr 25, 2003
Posts: 21
Hi Andrew,
The problem is come from server binding to name "DBMediator/" and the client is looking up "DBMediator"
Thx a lot. I really try a few day still cannot find the problem.
I agree. Here's the link:
subject: RMI Question, Please HELP
It's not a secret anymore!