aspose file tools*
The moose likes Distributed Java and the fly likes Problems with a simple RMI Hello World Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Problems with a simple RMI Hello World" Watch "Problems with a simple RMI Hello World" New topic
Author

Problems with a simple RMI Hello World

oli mueller
Ranch Hand

Joined: Feb 13, 2011
Posts: 42
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.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8924
    
    9

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

What is the full exception stack trace?


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19718
    
  20

Moving to Distributed Java.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Mir Mohammed Easin
Greenhorn

Joined: Mar 07, 2011
Posts: 4
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems with a simple RMI Hello World