Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

running server in RMI

  Asked By: Koila    Date: Feb 09    Category: Java    Views: 605

I have a project which uses RMI mechanism.
I want to load both client and servers sides on the same machine.
Would that cause any problem?

Any way, I cannot run neither Server nor client (of course when server does not
start client does not work!)

I want to meet somebody who is able to solve this problem. (I am living in
Tehran and I'm ready to pay for your time.)



2 Answers Found

Answer #1    Answered By: Midissia Lopez     Answered On: Feb 09

You can run  both the server  and client  applications on the same machine,
you must use rmic in the jdk to generate stubs when compiling your project, and for running  the project, you must use rmiregistry before calling java, and for running server, use -server option.
hope it can help you .

Answer #2    Answered By: Sebastien Anderson     Answered On: Feb 09

If you use J2SE 5 or higher version, it is not needed to use rmic to pregenerate stubs.
You can run  rmiregistry in your code, so it is not necessary to run rmiregistry before running  your app. The code looks like this:
LocateRegistry.createRegistry(int port);

Didn't find what you were looking for? Find more on running server in RMI Or get search suggestion and latest updates.