• Post Reply Bookmark Topic Watch Topic
  • New Topic

RMI Test

 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi people, i would like to try and run a simple "Hello World!" program using RMI. I have read many tutorials but can't seem to get it up and going.
Can some one please explain how i can do this, but giving me a example code or something.
I would like to try it under Eclipse.
I would like to try it on two different computers.

Thanks in advanced.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You said - "I have read many tutorials but can't seem to get it up and going."

Here's a link to Sun's "Hello World" RMI example...

What exactly is giving you problems? Are you getting the code to compile, but can't get it to run? Is the program complaining about security restrictions? Or that it can't find classes?
 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think i actually got it to compile, but i get a "java.security.AccessControlException: access denied" exception when i try to run it.

??
 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am following this tutorial. Check the code snippets out (if you want) to see if you see something which is incorrect.

Best regards,
Marzo.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error means that you need to set a security policy. (There's a note about this at the end of the tutorial you linked to - but it doesn't give you all the information you need to overcome this problem.)

This page of the tutorial I linked to goes more in depth on what you need to do...
 
Steven Johnson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been in the same boat - a lot of the tutorials seem to overcomplicate things. They add unnecessary features that obscure the basic functionality.

When you are ready to try the next step, such as a simple chat server, I'd recommend this tutorial:

RMI Chat tutorial

It is dead simple, explains things clearly, and has the bonus of showing how the server gets to communicate back to the client using the client's own remote methods. Plus it worked - although I did need to add the "anything goes" security policy from the Sun tutorial, in the server startup command.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!