tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick McGuire (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENEJB-1111) Openejb Logging does not interact well with PAX logging.
Date Wed, 18 Nov 2009 11:27:39 GMT
Openejb Logging does not interact well with PAX logging. 
---------------------------------------------------------

                 Key: OPENEJB-1111
                 URL: https://issues.apache.org/jira/browse/OPENEJB-1111
             Project: OpenEJB
          Issue Type: Improvement
            Reporter: Rick McGuire
            Assignee: Rick McGuire
             Fix For: 3.1.3


When used in an OSGi enabled environment where PAX logging is the enabled logging environment,
the openejb components have problems because of a NoClassDefFound exception when attempting
to initialize the logging environment.  The PAX logging implementation provides a subset of
the log APIs, but not the APIs for configuring the loggins environment.  Because of these
missing classes, the default Log4jLogStreamFactory class can't be loaded, resulting in a runtime
exception.  Openejb should have a more PAX friendly log stream factory available as an option.


Also, there's a small bug in the Logger code that initlizes the environment.  The following
code

    public static void configure() {
        String factoryName = System.getProperty("openejb.log.factory");
        Class<?> factoryClass = null;
        if (factoryName != null) {
            ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
            if (classLoader != null) {
                try {
                    factoryClass = classLoader.loadClass(factoryName);
                } catch (ClassNotFoundException e) {
                }
            }

            if (factoryClass != null) {
                try {
                    factoryClass = Class.forName(factoryName);
                } catch (ClassNotFoundException e) {
                }
            }
        }

Will load the factoryClass using the context class loader, and if that is successful, will
load again using Class.forName(), wiping out the first load event.  The factoryClass test
should be ==, not !=. 

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


Mime
View raw message