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 rmi method envoking parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "rmi method envoking parameters" Watch "rmi method envoking parameters" New topic

rmi method envoking parameters

Jochen Seliger

Joined: Jan 08, 2005
Posts: 8
Hi all,
I'm building a workflow system and have implemented different rmi servers on diferent machines.
The servers can properly looked up and their methods may be called.
Now I want to trasfer a file as argument.
As I have found in documentations it should be possible, if the file object is implemented serializable. I have done so.
Now the remote method by passing the serialized file (with fullPath) as argument is envoked.
On the remote mashine I can call fileName.getAbsoluteFile() or fileName.getAbsolutePath and in both cases the fullPath from / is shown.
But when calling fileName.getLength() or ask fileName.getAbsoluteFile().isFile(), an error 'call for reply failed access denied ( /tmp/SystemTarFile.tar.gz read)' by the calling method is shown.
In my case both boxes are running LINUX and in both cases the directory from where the argument file is to be read and where it could be put(on my oppinion) at the destination have a mode '777'.
Could anybody tell me, if it is generally possible to transfer files as argument to rmi server methods and haw to access these files on desination site.

Many thanks in foreward.

Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

Hi Jochen,

A few questions to help me understand what may be the problem...

First, are you using to send a file to a remote RMI method? Or is this your own implementation of something that represents a file? I guess my main question is, is it important that what you are sending is a "file" and not just the contents of the file? It may be easier to just use streams and send the contents of the file.

Second, you mentioned (in your PM) that you are creating a FilePermission object like this -

How are you setting this permission so that it can be used? I'll admit up front that I haven't looked a lot into the security architecture of Java, but I don't think that you can set up permissions dynamically in a method like that... (Unless you've implemented your own security manager or something...) I thought they had to be set up using a policy file on the command line?


Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link:
subject: rmi method envoking parameters
It's not a secret anymore!