openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1363887 - /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/logger/WebBeansLoggerFacade.java
Date Fri, 20 Jul 2012 18:18:25 GMT
Author: rmannibucau
Date: Fri Jul 20 18:18:25 2012
New Revision: 1363887

URL: http://svn.apache.org/viewvc?rev=1363887&view=rev
Log:
OWB-674 avoiding classes dependency which can fail with some JVM

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/logger/WebBeansLoggerFacade.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/logger/WebBeansLoggerFacade.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/logger/WebBeansLoggerFacade.java?rev=1363887&r1=1363886&r2=1363887&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/logger/WebBeansLoggerFacade.java
(original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/logger/WebBeansLoggerFacade.java
Fri Jul 20 18:18:25 2012
@@ -23,7 +23,6 @@ package org.apache.webbeans.logger;
  */
 
 import org.apache.webbeans.config.OWBLogConst;
-import org.apache.webbeans.util.WebBeansUtil;
 
 import java.text.MessageFormat;
 import java.util.Locale;
@@ -57,7 +56,14 @@ public final class WebBeansLoggerFacade
         {
             try
             {
-                Class<?> factoryClazz = WebBeansUtil.getCurrentClassLoader().loadClass(factoryClassname);
+                // don't use the org.apache.webbeans.util.WebBeansUtil.getCurrentClassLoader()
+                // to avoid weird dependency and potential failing
+                ClassLoader classloader = Thread.currentThread().getContextClassLoader();
+                if(classloader == null)
+                {
+                    classloader = WebBeansLoggerFacade.class.getClassLoader();
+                }
+                Class<?> factoryClazz = classloader.loadClass(factoryClassname);
                 factory = (WebBeansLoggerFactory) factoryClazz.newInstance();
             }
             catch (Exception e)



Mime
View raw message