1 Reply Latest reply on Apr 27, 2006 2:40 AM by anil.saldhana

    Security Manager Questions

    anil.saldhana

      Scott, when I run the jacc tests under a security manager. I get the following exception:

      Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission getProtectionDomain)
       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 java.lang.Class.getProtectionDomain(Class.java:1392)
       at org.jboss.ejb.EnterpriseContext$EJBContextImpl.isCallerInRoleCheckForJacc(EnterpriseContext.java:614)
       at org.jboss.ejb.EnterpriseContext$EJBContextImpl.isCallerInRole(EnterpriseContext.java:523)
       at org.jboss.ejb.StatelessSessionEnterpriseContext$SessionContextImpl.isCallerInRole(StatelessSessionEnterpriseContext.java:244)
      


      What this basically means is that I need to add a runtime permission for getProtectionDomain to the server.policy (testsuite/src/resources) used by the tests.

      In addition to the above, questions I have:
      a) Do I need to add a runtime permission anywhere else?
      b) I do not need a PrivilegedExceptionAction in this case. Right?



      A good reference url is:
      http://java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html