tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Blevins (JIRA)" <j...@apache.org>
Subject [jira] Updated: (OPENEJB-1111) PAX friendly LogStreamFactory for use in OSGi environments
Date Tue, 19 Oct 2010 02:38:27 GMT

     [ https://issues.apache.org/jira/browse/OPENEJB-1111?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

David Blevins updated OPENEJB-1111:
-----------------------------------

    Component/s: osgi
        Summary: PAX friendly LogStreamFactory for use in OSGi environments  (was: Openejb
Logging does not interact well with PAX logging. )

> PAX friendly LogStreamFactory for use in OSGi environments
> ----------------------------------------------------------
>
>                 Key: OPENEJB-1111
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1111
>             Project: OpenEJB
>          Issue Type: Improvement
>          Components: osgi
>            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