This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

rmi method envoking parameters  RSS feed

Jochen Seliger
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!