• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI server client

 
Abdul Ahadone
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i m new to java. i need to run this program using RMI. i need to give inputs from server side and get the implementation done at client side and get the result back to server.
i've tried by making client and server's implementation code and interfece code.... using rmi registryalso
But it's not executing...

but i m not getting how to do it...
Can any body help me out of this....


Thanks in advance...
Abdul

 
Ben Flowers
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I cant see anywhere in the code where you are actually looking up the server from the rmi registry (althoguh i did only havce a quick glance)
In your server code you need to extend UnicastRemoteObject and write the name of the server to the RMIRegistry with Naming.bind() (or use the static methods of UnicastRemoteObject)

Then you need to start the RMIRegistry with either
for linux/mac
or
for windows

Then you can launch your server, which will bind itself to the RMIRegistry.

Once the rmiregistry has been started and your server is online you can run your client.

In your client code you need to use the naming service to lookup your server


if you are doing it over two remote machines then you MUST install a security manager.

Hope that helps
-Ben
 
Abdul Ahadone
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will you please tell me how to remove main method in BoyerMooreImpl.java file which is above one.... I need to send parameters directly to calling method not to main method...
So for that i need to remove main method and shift its operations in other methods in it...and also return the values from other method...

This is my server program...:

I have done that,,....
 
kien kun
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have many error in your progamming.
You want to run a RMI application.
The first:
Make a interface class extend Remote

After that:

Make a implement from your interface which extend UnicastRemote

When run sever,You have to run rmiregistry
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abdul Ahadone wrote:i need to run this program using RMI. i need to give inputs from server side and get the implementation done at client side and get the result back to server.

So is this a homework assignment where your instructor says you must use RMI?

Obviously, you have to do what is asked, but after the assignment is completed, could you ask your instructor why RMI is still being taught?

See the thread in this section: http://www.coderanch.com/t/570237/java/java/Why-there-still-interest-lots
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic