Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with a simple RMI Hello World

 
oli mueller
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
Rob Spoor
Sheriff
Pie
Posts: 20388
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Distributed Java.
 
Mir Mohammed Easin
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic