3 Replies Latest reply on Mar 23, 2010 3:45 PM by anil.saldhana

    LoggingPermission for Logger integration

    anil.saldhana

      David,  looking at the following stacktrace, I am not really sure whether you want to be doing a checkAccess in your logging implementation.

       

       

      14:18:31,549 ERROR [STDERR] access: access denied (java.util.logging.LoggingPermission control)
      14:18:31,549 ERROR [STDERR] java.lang.Exception: Stack trace
      14:18:31,550 ERROR [STDERR]     at java.lang.Thread.dumpStack(Thread.java:1206)
      14:18:31,550 ERROR [STDERR]     at java.security.AccessControlContext.checkPermission(AccessControlContext.java:313)
      14:18:31,550 ERROR [STDERR]     at java.security.AccessController.checkPermission(AccessController.java:546)
      14:18:31,550 ERROR [STDERR]     at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
      14:18:31,550 ERROR [STDERR]     at org.jboss.logmanager.LogContext.checkAccess(LogContext.java:279)
      14:18:31,550 ERROR [STDERR]     at org.jboss.logmanager.Logger.attachIfAbsent(Logger.java:310)
      14:18:31,550 ERROR [STDERR]     at org.jboss.logging.logmanager.LoggerPluginImpl.getInstance(LoggerPluginImpl.java:51)
      14:18:31,550 ERROR [STDERR]     at org.jboss.logging.Logger.getDelegatePluginInstance(Logger.java:969)
      14:18:31,550 ERROR [STDERR]     at org.jboss.logging.Logger.getI18nLogger(Logger.java:871)
      14:18:31,550 ERROR [STDERR]     at org.jboss.logging.Logger.getLogger(Logger.java:895)
      14:18:31,550 ERROR [STDERR]     at org.jboss.logging.Logger.getLogger(Logger.java:921)
      14:18:31,550 ERROR [STDERR]     at org.jboss.services.binding.impl.PojoServiceBindingStore.<clinit>(PojoServiceBindingStore.java:48)
      14:18:31,550 ERROR [STDERR]     at org.jboss.services.binding.managed.ServiceBindingManagementObject.<init>(ServiceBindingManagementObject.java:71)
      14:18:31,550 ERROR [STDERR]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      

       

      The reason I ask is now every static initialization of the Logger in any class has to either go in a privileged block or we need to assign permissions to the entire call stack.