1 Reply Latest reply on Nov 28, 2006 11:35 AM by Benjamin Cuthbert

    access denied security policy write

    Benjamin Cuthbert Newbie

      All i have a strange problem with my RMI client, i am trying to connect to the jboss which has been started in my VM by eclipse, when i try and access it i get the following error.

      java.security.AccessControlException: access denied (java.util.PropertyPermission java.security.policy write)
       at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
       at java.security.AccessController.checkPermission(AccessController.java:427)
       at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
      


      I have setup the security manager

       System.setProperty("java.security.policy", "client.policy");
       if (System.getSecurityManager() == null)
       System.setSecurityManager(new RMISecurityManager());
       Properties env = new Properties();
      // Definir las propiededes y ubicacion de busqueda de Nombres JNDI.
       env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
       env.setProperty("java.naming.provider.url", "localhost:1099");
       env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
       InitialContext ic = new InitialContext(env);
      


      And i have created the client policy file

      grant {
      permission java.security.AllPermission;
      };

      And in the eclipse run as option i put in VM args

      -Djava.security.manager -Djava.security.policy=client.policy