commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bartosz Baranowski (JIRA)" <>
Subject [jira] Created: (LOGGING-134) No AccessControll on getClassLoader operations
Date Tue, 29 Dec 2009 13:28:29 GMT
No AccessControll on getClassLoader operations

                 Key: LOGGING-134
             Project: Commons Logging
          Issue Type: Improvement
    Affects Versions: 1.1.1
         Environment: JDK1.6, WinXP SP2. Ran under JBoss 5.1.GA, mobicents 2.0.B2, 
            Reporter: Bartosz Baranowski
            Priority: Trivial
             Fix For: 1.1.1

Problem is that commons logging performs some operations (atleast getClassLoader) which requiere
access permissions. Since commons do not encapsulate calls to class loader getters in "doPriviledged"
initialization of loggers fail.
This would not be a big deal if it wasnt about loggers - which usually are decalred "static
final" and usually poeple dont use "static{}" to init logger like:

private final static Logger log;

   log=AccessController.doPriviledged(new PriviledgedAction<Logger>()
     public Object run()
             return Logger.getLogger(class); 



Example fail log  on 1.1.1:

Caused by: org.apache.commons.logging.LogConfigurationException:
access denied (java.lang.RuntimePermission getClassLoader) (Caused by
Exception: access denied (java.lang.RuntimePermission getClassLoader))
        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(
        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
        at org.apache.commons.logging.LogFactory.getLog(
        at org.jboss.cache.commands.write.RemoveNodeCommand.<clinit>(
        ... 22 more
Caused by: access denied (java.lang.RuntimePermission
        at Source)
        at Source)
        at java.lang.SecurityManager.checkPermission(Unknown Source)
        at java.lang.ClassLoader.getParent(Unknown Source)
        at org.apache.commons.logging.impl.LogFactoryImpl.getLowestClassLoader(
        at org.apache.commons.logging.impl.LogFactoryImpl.getBaseClassLoader(
        at org.apache.commons.logging.impl.LogFactoryImpl.createLogFromClass(
        at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(
        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(
        ... 26 more

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message