Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problems with a simple RMI Hello World

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I would like to try a simple RMI hello world with Java1.5 (and using eclipse if that matters). I have probably tryed every available step-by-step tutorial on the web - none of them works for me...what am i doing wrong...

(1) Some make some changes in the .policy files, some don*t....some have enter some "codebase", others dont...I am getting ClassNotFoundExceptions in any case....

Here is what i am doing...
The interface:


The Server-class...(if i run it from eclipse, i am getting classnotfoundexceptions....)


...i leave the client out, as it is not so interesting at the moment. I do have my rmiregistry running...Does anybody know, WHAT exactly I have to configure and WHERE exactly....all tutorials I found on the web, focus on the source code (which is perfectly clear in my opinion), but they are very thin on these configurations to make the bloody thing running.....

I APPRECIATE YOUR HELP.
thanks.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

oli mueller wrote:
The Server-class...(if i run it from eclipse, i am getting classnotfoundexceptions....)


What is the full exception stack trace?
 
Sheriff
Posts: 22791
131
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to Distributed Java.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
If your exception is regarding stub class like Server_Stub.class or remote object class not found which means when you try to run your RMI server, you need to create stub class of your remote object class. For JDK1.6 doesn't need. So you've to create a Stub class as follow:

<class_directory>rmic example.hello.Server

It'll generate Server_Stub.class [also can generate Server_Skel.class for JDK1.4]. And then you need to specify codebase into your command line like:

<class_directory>java -Djava.rmi.server.codebase=file://<class directory path>/ example.hello.Server

You can programically define above codebase in your Server program:



I hope you'll not get any exception regarding class not found.

Cheers
 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic