• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

RMI Test

 
Ranch Hand
Posts: 528
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic