• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI Question, Please HELP

 
Alan A Smith
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I using RMI as client/server communication. It works fine on rmi default port 1099. The following is my code:
Server:

Client

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
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Alan A Smith
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 11887
203
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Alan A Smith
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Regards,
Alan
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic