jQuery in Action, 2nd edition*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Policy File in RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Policy File in RMI " Watch "Policy File in RMI " New topic
Author

Policy File in RMI

chandu shah
Greenhorn

Joined: Jul 09, 2001
Posts: 4
Hello,
I have one deoubt in RMI .
I read in book that u must have policy file.... also everyone are either using Securtity manager or policy file.
BUT my network mode works perfactly without using security file or anything else.
Please tell me exact use of policy file in our FBN project. (Because in policy file default sentance is permission to all , and in my case there is no policy file at all!! What is difference ?!
I am afraid that I may be wrong somewhere ... please guide me on this issue.
ck
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
As far as I understand, you only need to set your security manager to a RMISecurityManager, if you decide you will allow the dynamic download of stubs. If you do change your security manager, as the RMISecurityManager is "more restrictive" than no security manager, you should also provide a policy file granting permissions for accepting socket connections, etc... Or you could also sublclass RMISecurityManager and do the same thing (perhaps in a more obscure way).
So, if you decide you won�t be downloading stubs, but rather you will provide compiled ones in your package, you don�t have a need to change the security manager or provide a policy file...
Could anybody else with better knowledge expand this???
Benjam�n
Dilip kumar
Ranch Hand

Joined: Oct 16, 2000
Posts: 360
With your existing setup, run the application in network mode with port # other than 1099 and see whether it works.
chandu shah
Greenhorn

Joined: Jul 09, 2001
Posts: 4
I had already tried using another port I also tried using two diiferent machine in network It all works!! And above all question is if we are giving all permision than whats is the use of Policy file.

Akanimo Udoh
Ranch Hand

Joined: Jun 11, 2001
Posts: 48
Chandu,
The reason yours works fine without the policy file is probably because the default policy file that is installed with the JDK probably already gives you all the permissions you need (check ${java.home}/jre/lib/security/java.policy). You cannot assume that the default policy file on the tester's machine will grant the same permissions so its good you define your own policy file giving:
1. Read/write access to the database file.
2. Resolve, Listen, Connect permissions on the communicating ports.
You might also want to read ${java.home}/jre/lib/security/java.security.
Akanimo.
[This message has been edited by Akanimo Udoh (edited July 10, 2001).]
chandu shah
Greenhorn

Joined: Jul 09, 2001
Posts: 4
Thanks Akanimo, I will try...
chandu
Originally posted by Akanimo Udoh:
Chandu,
The reason yours works fine without the policy file is probably because the default policy file that is installed with the JDK probably already gives you all the permissions you need (check ${java.home}/jre/lib/security/java.policy). You cannot assume that the default policy file on the tester's machine will grant the same permissions so its good you define your own policy file giving:
1. Read/write access to the database file.
2. Resolve, Listen, Connect permissions on the communicating ports.
You might also want to read ${java.home}/jre/lib/security/java.security.
Akanimo.
[This message has been edited by Akanimo Udoh (edited July 10, 2001).]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Policy File in RMI
 
Similar Threads
RMI Server written in Microsoft SDk 4 - Its Urgent
Need Help for RMI
include policy file in jar?
What is the significance of security manager policy file and what is the syntax
policy file