Advertisement
|
This page contains an archived post to the Jini Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
Use a diiferent policy file
Posted by Sunil Chowgale on August 17, 2001 at 8:06 AM
hi, even i used to get this exception while using policy.all policy file. its a bad habit of using grant permission to all. i tried with a different policy file wherein i specified as permissions as below. /* * This is an example policy file for the lookup service's activation group. * You should be able to use this as-is if you use reggie.jar as an * executable jar file, or if the classpath you use when running * com.sun.jini.reggie.CreateLookup is just a single jar file or a single * directory with a trailing slash. Otherwise you need to replace the * codebase string below. If you want the lookup database stored somewhere * other than in /tmp/reggie_log/, then change that as well. */ grant codebase "file:${java.class.path}" { // file system dependent permissions for unix file system permission java.io.FilePermission "./*", "read,write,execute,delete"; permission java.io.FilePermission "/tmp", "read,write,execute,delete"; permission java.io.FilePermission "/tmp/-", "read,write,execute,delete"; permission java.io.FilePermission "/var/tmp", "read,write,execute,delete"; permission java.io.FilePermission "/var/tmp/-", "read,write,execute,delete"; // uncomment this one if you need lookup to accept file: codebases // permission java.io.FilePermission "<>", "read"; permission java.lang.RuntimePermission "modifyThreadGroup"; permission java.lang.RuntimePermission "modifyThread"; permission java.net.SocketPermission "*:1024-", "connect,accept"; // for http: codebases permission java.net.SocketPermission "*:80", "connect"; permission java.net.SocketPermission "127.0.0.1:4160", "connect"; permission java.net.SocketPermission "192.0.0.7:8888", "connect"; permission java.net.SocketPermission "sunil:8888", "connect"; permission java.net.SocketPermission "192.0.0.7", "connect,accept"; permission java.net.SocketPermission "127.0.0.1", "connect,accept"; permission java.net.SocketPermission "224.0.1.85", "connect,accept"; permission java.net.SocketPermission "224.0.1.84", "connect,accept"; permission java.util.PropertyPermission "java.rmi.server.hostname", "read"; permission java.util.PropertyPermission "com.sun.jini.reggie.*", "read"; permission java.util.PropertyPermission "net.jini.discovery.*", "read"; permission net.jini.discovery.DiscoveryPermission "*"; permission net.jini.discovery.DiscoveryPermission "public"; permission net.jini.discovery.DiscoveryPermission "HelloServer"; // for transient case only permission java.lang.RuntimePermission "getContextClassLoader"; permission java.lang.RuntimePermission "setContextClassLoader"; // file system dependent permissions for windows file system permission java.io.FilePermission ".\\*", "read,write,execute,delete"; permission java.io.FilePermission "c:\\temp", "read,write,execute,delete"; permission java.io.FilePermission "c:\\temp\\-", "read,write,execute,delete"; permission java.io.FilePermission "c:\\windows\\temp", "read,write,execute,delete"; permission java.io.FilePermission "c:\\windows\\temp\\-", "read,write,execute,delete"; permission java.io.FilePermission "d:\\temp", "read,write,execute,delete"; permission java.io.FilePermission "d:\\temp\\-", "read,write,execute,delete"; permission java.io.FilePermission "d:\\windows\\temp", "read,write,execute,delete"; permission java.io.FilePermission "d:\\windows\\temp\\-", "read,write,execute,delete"; };
Replies:
|