wood burning stoves 2.0*
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
Author

rmi method envoking parameters

Jochen Seliger
Greenhorn

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 java.security.AccessControlException: access denied (java.io.FilePermission /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.

Jochen
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Hi Jochen,

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

First, are you using java.io.File 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?

-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: rmi method envoking parameters
 
Similar Threads
how to get Clients CPU information on Server using Java RMI
Question regarding RMI
Problem in Factory Patterns
NX: URLYBird / my approach of the reading problem
B&S: Doubts in RMI