File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Distributed Java and the fly likes Question about RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Question about RMI" Watch "Question about RMI" New topic

Question about RMI

Ian Gumby

Joined: Sep 11, 2009
Posts: 4
I finally got my rmi based client/server app working.

But I had hit a bit of a wall and today I created a solution.. javascript:emoticon('');

Since I didn't want to create a complete web service, I chose to use the sample from Sun.

It works ok if you are going to put your class files in a directory and you just point to the directory.
It fails miserably when you keep your files in a jar file and just point your codebase to your jar file.
(The simple class doesn't know how to handle jars.)

So I ran in to a little roadblock that didn't make sense....javascript:emoticon(''); .
When I started the server, I could see the registry, but when I was rebinding my instance, it blew up.

It turns out that when I did the binding/rebinding of my implementation class, under the covers, the registry is trying to get a copy of the entire jar file.
This was unexpected. Well I fixed the code to handle a jar file request, and it works, but I'm still confused.

I had thought that the registry would have gone to the jar file and requested the single class file. (I had already written the code to handle those cases using a JarFile object....

So my question is why did the registry wan't the entire jar file when I called registry.rebind("Service",obj) ?

Still learning ... javascript:emoticon('');

I agree. Here's the link:
subject: Question about RMI
It's not a secret anymore!