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.
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?
Write once, run anywhere, because there's nowhere to hide! - /. A.C.