1 Reply Latest reply on Sep 3, 2005 11:41 PM by Scott Stark

    AccessControlException with System.setSecurityManager()

    Mark Ricard Newbie

      Using JBoss 4.0.2

      In a web application, I make the following call:

      System.setProperty("java.security.policy", securityPolicy);
      if (System.getSecurityManager() == null) {
      System.setSecurityManager(new RMISecurityManager());
      }

      The security policy variable contains a path to a java.policy file that I have used many times. It grants allPermission for testing purposes.

      I get the following error that just keeps repeating itself in the JBoss 'log' in some fashion:

      java.security.AccessControlException: access denied (javax.management.MBeanPermission org.jboss.mx.modelmbean.XMBean#SuffixOrder[jboss.system:service=MainDeployer] getAttribute)
      at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
      at java.security.AccessController.checkPermission(AccessController.java:401)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
      at org.jboss.mx.server.MBeanServerImpl.checkMBeanPermission(MBeanServerImpl.java:1700)
      at org.jboss.mx.server.MBeanServerImpl.getAttribute(MBeanServerImpl.java:536)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:115)
      at $Proxy10.getSuffixOrder(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.updateSorter(URLDeploymentScanner.java:536)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:379)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:215)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:194)



      Does anyone know what I am doing wrong?