[slf4j-dev] [GIT] SLF4J: Simple Logging Facade for Java branch, master, updated. v1.5.9.RC1-23-gdae55b8

added by portage for gitosis-gentoo git-noreply at pixie.qos.ch
Thu Feb 25 12:45:43 CET 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SLF4J: Simple Logging Facade for Java".

The branch, master has been updated
       via  dae55b822906cbb5b701e6f58199e9b50c0e2df8 (commit)
      from  99c9eb8a756df79e94234f00a348b0ee6222098e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.qos.ch/gitweb/?p=slf4j.git;a=commit;h=dae55b822906cbb5b701e6f58199e9b50c0e2df8
http://github.com/ceki/slf4j/commit/dae55b822906cbb5b701e6f58199e9b50c0e2df8

commit dae55b822906cbb5b701e6f58199e9b50c0e2df8
Author: Ceki Gulcu <ceki at qos.ch>
Date:   Thu Feb 25 12:42:32 2010 +0100

    - preparing release 1.5.11
    
    - added code to detect the simultaneous presence of both
    log4j-over-slf4j.jar and slf4j-log4j12.jar. See also
    http://slf4j.org/codes.html#log4jDelegationLoop
    
    - added code to detect the simultaneous presence of both
    jcl-over-slf4j.jar and slf4j-jcl.jar. See also
    http://slf4j.org/codes.html#jclDelegationLoop
    
    - Fixed http://bugzilla.slf4j.org/show_bug.cgi?id=168

diff --git a/integration/pom.xml b/integration/pom.xml
index b5e2ef7..baff429 100644
--- a/integration/pom.xml
+++ b/integration/pom.xml
@@ -6,7 +6,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-    	<version>1.5.10</version>
+    	<version>1.5.11</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>
diff --git a/jcl-over-slf4j/pom.xml b/jcl-over-slf4j/pom.xml
index cac58f7..0d67bbb 100644
--- a/jcl-over-slf4j/pom.xml
+++ b/jcl-over-slf4j/pom.xml
@@ -3,7 +3,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-    <version>1.5.10</version>
+    <version>1.5.11</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>
diff --git a/jcl104-over-slf4j/pom.xml b/jcl104-over-slf4j/pom.xml
index 5ce0a74..f8f8d4e 100644
--- a/jcl104-over-slf4j/pom.xml
+++ b/jcl104-over-slf4j/pom.xml
@@ -3,7 +3,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-    <version>1.5.10</version>
+    <version>1.5.11</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>
diff --git a/jul-to-slf4j/pom.xml b/jul-to-slf4j/pom.xml
index 2bf3d27..a5b759b 100644
--- a/jul-to-slf4j/pom.xml
+++ b/jul-to-slf4j/pom.xml
@@ -6,7 +6,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-    	<version>1.5.10</version>
+    	<version>1.5.11</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>
diff --git a/log4j-over-slf4j/pom.xml b/log4j-over-slf4j/pom.xml
index 9cd2586..2f6d2d3 100644
--- a/log4j-over-slf4j/pom.xml
+++ b/log4j-over-slf4j/pom.xml
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.slf4j</groupId>
     <artifactId>slf4j-parent</artifactId>
-    <version>1.5.10</version>
+    <version>1.5.11</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
diff --git a/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java b/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java
index 279111e..0d5d765 100644
--- a/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java
+++ b/log4j-over-slf4j/src/main/java/org/apache/log4j/Category.java
@@ -45,6 +45,8 @@ public class Category {
   protected org.slf4j.Logger slf4jLogger;
   private org.slf4j.spi.LocationAwareLogger locationAwareLogger;
 
+  
+  
   private static Marker FATAL_MARKER = MarkerFactory.getMarker("FATAL");
 
   Category(String name) {
diff --git a/log4j-over-slf4j/src/main/java/org/apache/log4j/Log4jLoggerFactory.java b/log4j-over-slf4j/src/main/java/org/apache/log4j/Log4jLoggerFactory.java
index fb3a70e..d8d0ad7 100644
--- a/log4j-over-slf4j/src/main/java/org/apache/log4j/Log4jLoggerFactory.java
+++ b/log4j-over-slf4j/src/main/java/org/apache/log4j/Log4jLoggerFactory.java
@@ -18,6 +18,8 @@ package org.apache.log4j;
 
 import java.util.Hashtable;
 
+import org.slf4j.helpers.Util;
+
 /**
  * This class is a factory that creates and maintains org.apache.log4j.Loggers
  * wrapping org.slf4j.Loggers.
@@ -32,12 +34,30 @@ class Log4jLoggerFactory {
   // String, Logger
   private static Hashtable log4jLoggers = new Hashtable();
 
+  private static final String LOG4J_DELEGATION_LOOP_URL = "http://www.slf4j.org/codes.html#log4jDelegationLoop";
+  
+  // check for delegation loops
+  static {
+    try {
+      Class.forName("org.slf4j.impl.Log4jLoggerFactory");
+      String part1 = "Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError. ";
+      String part2 = "See also " + LOG4J_DELEGATION_LOOP_URL
+          + " for more details.";
+
+      Util.reportFailure(part1);
+      Util.reportFailure(part2);
+            throw new IllegalStateException(part1 + part2);
+    } catch (ClassNotFoundException e) {
+      // this is the good case
+    }
+  }
+
   public static synchronized Logger getLogger(String name) {
     if (log4jLoggers.containsKey(name)) {
       return (org.apache.log4j.Logger) log4jLoggers.get(name);
     } else {
       Logger log4jLogger = new Logger(name);
-      
+
       log4jLoggers.put(name, log4jLogger);
       return log4jLogger;
     }
diff --git a/osgi-over-slf4j/pom.xml b/osgi-over-slf4j/pom.xml
index ff81748..84197ba 100644
--- a/osgi-over-slf4j/pom.xml
+++ b/osgi-over-slf4j/pom.xml
@@ -3,7 +3,7 @@
   <parent>
     <groupId>org.slf4j</groupId>
     <artifactId>slf4j-parent</artifactId>
-    <version>1.5.10</version>
+    <version>1.5.11</version>
   </parent>
   
   <modelVersion>4.0.0</modelVersion>
diff --git a/pom.xml b/pom.xml
index b0514fb..192f5e8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
 
 	<groupId>org.slf4j</groupId>
 	<artifactId>slf4j-parent</artifactId>
-	<version>1.5.10</version>
+	<version>1.5.11</version>
 
 	<packaging>pom</packaging>
 	<name>SLF4J</name>
diff --git a/slf4j-api/pom.xml b/slf4j-api/pom.xml
index e93733d..c272650 100644
--- a/slf4j-api/pom.xml
+++ b/slf4j-api/pom.xml
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.slf4j</groupId>
     <artifactId>slf4j-parent</artifactId>
-    <version>1.5.10</version>
+    <version>1.5.11</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java b/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java
index 6dd10e4..068d3df 100644
--- a/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java
+++ b/slf4j-api/src/main/java/org/slf4j/LoggerFactory.java
@@ -85,7 +85,7 @@ public final class LoggerFactory {
    * compatibility. Thus, 1.5.7-SNAPSHOT, 1.5.7.RC0 are compatible with 1.5.7.
    */
   static private final String[] API_COMPATIBILITY_LIST = new String[] {
-      "1.5.5", "1.5.6", "1.5.7", "1.5.8", "1.5.9", "1.5.10" };
+      "1.5.5", "1.5.6", "1.5.7", "1.5.8", "1.5.9", "1.5.10", "1.5.11" };
 
   // private constructor prevents instantiation
   private LoggerFactory() {
diff --git a/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
index 89b97da..169b747 100644
--- a/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
+++ b/slf4j-api/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
@@ -61,7 +61,7 @@ public class StaticLoggerBinder {
    * The value of this field is usually modified with each release. 
    */
   // to avoid constant folding by the compiler, this field must *not* be final
-  public static String REQUESTED_API_VERSION = "1.5.10";  // !final
+  public static String REQUESTED_API_VERSION = "1.5.11";  // !final
   
   private StaticLoggerBinder() {
     throw new UnsupportedOperationException("This code should have never made it into the jar");
diff --git a/slf4j-ext/pom.xml b/slf4j-ext/pom.xml
index 636f9b0..8c16a11 100644
--- a/slf4j-ext/pom.xml
+++ b/slf4j-ext/pom.xml
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.slf4j</groupId>
     <artifactId>slf4j-parent</artifactId>
-    <version>1.5.10</version>
+    <version>1.5.11</version>
   </parent>
 
   <modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-jcl/pom.xml b/slf4j-jcl/pom.xml
index edaaa0a..088560b 100644
--- a/slf4j-jcl/pom.xml
+++ b/slf4j-jcl/pom.xml
@@ -3,7 +3,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-		<version>1.5.10</version>
+		<version>1.5.11</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-jcl/src/main/java/org/slf4j/impl/JCLLoggerFactory.java b/slf4j-jcl/src/main/java/org/slf4j/impl/JCLLoggerFactory.java
index fddaf91..c3ce664 100644
--- a/slf4j-jcl/src/main/java/org/slf4j/impl/JCLLoggerFactory.java
+++ b/slf4j-jcl/src/main/java/org/slf4j/impl/JCLLoggerFactory.java
@@ -39,6 +39,7 @@ import java.util.Map;
 import org.apache.commons.logging.LogFactory;
 import org.slf4j.ILoggerFactory;
 import org.slf4j.Logger;
+import org.slf4j.helpers.Util;
 
 /**
  * JCLLoggerFactory is an implementation of {@link ILoggerFactory} returning the
@@ -48,6 +49,24 @@ import org.slf4j.Logger;
  */
 public class JCLLoggerFactory implements ILoggerFactory {
 
+  private static final String JCL_DELEGATION_LOOP_URL = "http://www.slf4j.org/codes.html#jclDelegationLoop";
+
+  // check for delegation loops
+  static {
+    try {
+      Class.forName("org.apache.commons.logging.impl.SLF4JLogFactory");
+      String part1 = "Detected both jcl-over-slf4j.jar AND slf4j-jcl.jar on the class path, preempting StackOverflowError. ";
+      String part2 = "See also " + JCL_DELEGATION_LOOP_URL
+          + " for more details.";
+
+      Util.reportFailure(part1);
+      Util.reportFailure(part2);
+      throw new IllegalStateException(part1 + part2);
+    } catch (ClassNotFoundException e) {
+      // this is the good case
+    }
+  }
+
   // key: name (String), value: a JCLLoggerAdapter;
   Map loggerMap;
 
diff --git a/slf4j-jcl/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-jcl/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
index 2b2514a..9fea2be 100644
--- a/slf4j-jcl/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
+++ b/slf4j-jcl/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
@@ -65,7 +65,7 @@ public class StaticLoggerBinder implements LoggerFactoryBinder {
    */ 
   
   //to avoid constant folding by the compiler, this field must *not* be final
-  public static String REQUESTED_API_VERSION = "1.5.10";  
+  public static String REQUESTED_API_VERSION = "1.5.11";  
   
   // Binding specific code:
   private static final String loggerFactoryClassStr = JCLLoggerFactory.class
diff --git a/slf4j-jdk14/pom.xml b/slf4j-jdk14/pom.xml
index 8ca8ef6..1cc86d1 100644
--- a/slf4j-jdk14/pom.xml
+++ b/slf4j-jdk14/pom.xml
@@ -6,7 +6,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-    	<version>1.5.10</version>
+    	<version>1.5.11</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-jdk14/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-jdk14/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
index c4d2073..92e9db8 100644
--- a/slf4j-jdk14/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
+++ b/slf4j-jdk14/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
@@ -66,7 +66,7 @@ public class StaticLoggerBinder implements LoggerFactoryBinder {
    * The value of this field is usually modified with each release. 
    */
   // to avoid constant folding by the compiler, this field must *not* be final
-  public static String REQUESTED_API_VERSION = "1.5.10";  // !final
+  public static String REQUESTED_API_VERSION = "1.5.11";  // !final
 
   
   private static final String loggerFactoryClassStr = org.slf4j.impl.JDK14LoggerFactory.class.getName();
diff --git a/slf4j-log4j12/pom.xml b/slf4j-log4j12/pom.xml
index e8a6548..070e32f 100644
--- a/slf4j-log4j12/pom.xml
+++ b/slf4j-log4j12/pom.xml
@@ -6,7 +6,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-        <version>1.5.10</version>
+        <version>1.5.11</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
index 6cf6d23..2e86c52 100644
--- a/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
+++ b/slf4j-log4j12/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
@@ -66,7 +66,7 @@ public class StaticLoggerBinder implements LoggerFactoryBinder {
    * against. The value of this field is usually modified with each release.
    */
   // to avoid constant folding by the compiler, this field must *not* be final
-  public static String REQUESTED_API_VERSION = "1.5.10"; // !final
+  public static String REQUESTED_API_VERSION = "1.5.11"; // !final
 
   private static final String loggerFactoryClassStr = Log4jLoggerFactory.class
       .getName();
diff --git a/slf4j-migrator/pom.xml b/slf4j-migrator/pom.xml
index 69392d0..768a9b0 100644
--- a/slf4j-migrator/pom.xml
+++ b/slf4j-migrator/pom.xml
@@ -7,7 +7,7 @@
 	<parent>
 	  <groupId>org.slf4j</groupId>
       <artifactId>slf4j-parent</artifactId>
-      <version>1.5.10</version>
+      <version>1.5.11</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-nop/pom.xml b/slf4j-nop/pom.xml
index fed1241..01f7781 100644
--- a/slf4j-nop/pom.xml
+++ b/slf4j-nop/pom.xml
@@ -6,7 +6,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-    	<version>1.5.10</version>
+    	<version>1.5.11</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-nop/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-nop/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
index 109e415..4c14792 100644
--- a/slf4j-nop/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
+++ b/slf4j-nop/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
@@ -66,7 +66,7 @@ public class StaticLoggerBinder  implements LoggerFactoryBinder {
    * The value of this field is usually modified with each release. 
    */
   // to avoid constant folding by the compiler, this field must *not* be final
-  public static String REQUESTED_API_VERSION = "1.5.10";  // !final
+  public static String REQUESTED_API_VERSION = "1.5.11";  // !final
   
   private static final String loggerFactoryClassStr = NOPLoggerFactory.class.getName();
 
diff --git a/slf4j-osgi-integration-test/pom.xml b/slf4j-osgi-integration-test/pom.xml
index 8ea99dc..8951a13 100644
--- a/slf4j-osgi-integration-test/pom.xml
+++ b/slf4j-osgi-integration-test/pom.xml
@@ -6,7 +6,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-		<version>1.5.10</version>
+		<version>1.5.11</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-osgi-test-bundle/pom.xml b/slf4j-osgi-test-bundle/pom.xml
index 723382e..97c09a2 100644
--- a/slf4j-osgi-test-bundle/pom.xml
+++ b/slf4j-osgi-test-bundle/pom.xml
@@ -6,7 +6,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-		<version>1.5.10</version>
+		<version>1.5.11</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-simple/pom.xml b/slf4j-simple/pom.xml
index cb5c89c..f582310 100644
--- a/slf4j-simple/pom.xml
+++ b/slf4j-simple/pom.xml
@@ -3,7 +3,7 @@
   <parent>
     <groupId>org.slf4j</groupId>
     <artifactId>slf4j-parent</artifactId>
-    <version>1.5.10</version>
+    <version>1.5.11</version>
   </parent>
 	
 	<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-simple/src/main/java/org/slf4j/impl/StaticLoggerBinder.java b/slf4j-simple/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
index 5bc87a4..064cb9e 100644
--- a/slf4j-simple/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
+++ b/slf4j-simple/src/main/java/org/slf4j/impl/StaticLoggerBinder.java
@@ -58,7 +58,7 @@ public class StaticLoggerBinder implements LoggerFactoryBinder {
    * against. The value of this field is usually modified with each release.
    */
   // to avoid constant folding by the compiler, this field must *not* be final
-  public static String REQUESTED_API_VERSION = "1.5.10";  // !final
+  public static String REQUESTED_API_VERSION = "1.5.11";  // !final
   
   private static final String loggerFactoryClassStr = SimpleLoggerFactory.class.getName();
 
diff --git a/slf4j-site/pom.xml b/slf4j-site/pom.xml
index c17dacd..68116ff 100644
--- a/slf4j-site/pom.xml
+++ b/slf4j-site/pom.xml
@@ -5,7 +5,7 @@
 	<parent>
 		<groupId>org.slf4j</groupId>
 		<artifactId>slf4j-parent</artifactId>
-    <version>1.5.10</version>
+    <version>1.5.11</version>
 	</parent>
 	
 	<modelVersion>4.0.0</modelVersion>
diff --git a/slf4j-site/src/site/pages/codes.html b/slf4j-site/src/site/pages/codes.html
index 2c72e02..f5d7ed2 100644
--- a/slf4j-site/src/site/pages/codes.html
+++ b/slf4j-site/src/site/pages/codes.html
@@ -1,11 +1,13 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
-<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
-<title>SLF4J Error Codes</title>
-<link rel="stylesheet" type="text/css" media="screen" href="css/site.css" />
+  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+  <title>SLF4J Error Codes</title>
+  <link rel="stylesheet" type="text/css" media="screen" href="css/site.css" />
+  <link rel="stylesheet" type="text/css" href="css/prettify.css" />
 </head>
-<body>
+<body onload="prettyPrint()">
+    <script type="text/javascript" src="js/prettify.js"></script>
     <script type="text/javascript">prefix='';</script>
 
     <script src="templates/header.js" type="text/javascript"></script>
@@ -13,6 +15,7 @@
       <script src="templates/left.js" type="text/javascript"></script>
     </div>
 
+
     <div id="content">
 
     <center>
@@ -151,7 +154,7 @@
     <em>slf4j-simple-${version}.jar</em> and
     <em>slf4j-nop-${version}.jar</em> on the class path and you wish
     to use the nop (no-operation) binding, then remove
-    <em>slf4j-simple-${version}.jar</em> from the class parh.</p>
+    <em>slf4j-simple-${version}.jar</em> from the class path.</p>
 
 
     <!-- ====================================================== -->
@@ -168,7 +171,102 @@
     an effective remedy.
     </p>
 
-    
+    <!-- ====================================================== -->
+
+    <h3>
+      <a name="log4jDelegationLoop"
+      href="#log4jDelegationLoop">Detected both log4j-over-slf4j.jar
+      AND slf4j-log4j12.jar on the class path, preempting
+      <code>StackOverflowError</code>.</a>
+    </h3>
+
+    <p>The purpose of slf4j-log4j12 module is to delegate or redirect
+    calls made to an SLF4J logger to log4j. The purpose of the
+    log4j-over-slf4j module is to redirect calls made to a log4j
+    logger to SLF4J. If both <em>slf4j-log4j12.jar</em> and
+    <em>log4j-over-slf4j.jar</em> are present on the class path, a
+    <code>StackOverflowError</code> will inevitably occur immediately
+    after the first invocation of an SLF4J or a log4j logger.
+    </p>
+
+    <p>Here is how the exception might look like:</p>
+
+    <pre class="prettyprint source">Exception in thread "main" java.lang.StackOverflowError
+  at java.util.Hashtable.containsKey(Hashtable.java:306)
+  at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:36)
+  at org.apache.log4j.LogManager.getLogger(LogManager.java:39)
+  at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73)
+  at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:249)
+  at org.apache.log4j.Category.&lt;init>(Category.java:53)
+  at org.apache.log4j.Logger..&lt;init>(Logger.java:35)
+  at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:39)
+  at org.apache.log4j.LogManager.getLogger(LogManager.java:39)
+  at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73)
+  at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:249)
+  at org.apache.log4j.Category..&lt;init>(Category.java:53)
+  at org.apache.log4j.Logger..&lt;init>(Logger.java:35)
+  at org.apache.log4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:39)
+  at org.apache.log4j.LogManager.getLogger(LogManager.java:39)
+  subsequent lines omitted...</pre>
+
+    <p>As of SLF4J version 1.5.11, the code preempts the inevitable
+    stack overflow error by throwing an exception with details about
+    the actual cause of the problem. This is deemed to be better than
+    leaving the user wondering about the reasons of the
+    <code>StackOverflowError</code>.
+    </p>
+
+    <p>For more background on this topic see <a
+    href="legacy.html">Bridging legacy APIs</a>.
+    </p>
+
+    <!-- ====================================================== -->
+
+
+    <h3>
+      <a name="jclDelegationLoop" href="#jclDelegationLoop">Detected
+      both jcl-over-slf4j.jar AND slf4j-jcl.jar on the class path,
+      preempting <code>StackOverflowError</code>.</a>
+    </h3>
+
+    <p>The purpose of slf4j-jcl module is to delegate or redirect
+    calls made to an SLF4J logger to jakarta commons logging
+    (JCL). The purpose of the jcl-over-slf4j module is to redirect
+    calls made to a JCL logger to SLF4J. If both
+    <em>slf4j-jcl.jar</em> and <em>jcl-over-slf4j.jar</em> are present
+    on the class path, then a <code>StackOverflowError</code> will
+    inevitably occur immediately after the first invocation of an
+    SLF4J or a JCL logger. 
+    </p>
+
+    <p>Here is how the exception might look like:</p>
+
+    <pre class="prettyprint source">Exception in thread "main" java.lang.StackOverflowError
+  at java.lang.String.hashCode(String.java:1482)
+  at java.util.HashMap.get(HashMap.java:300)
+  at org.slf4j.impl.JCLLoggerFactory.getLogger(JCLLoggerFactory.java:67)
+  at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:249)
+  at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
+  at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:289)
+  at org.slf4j.impl.JCLLoggerFactory.getLogger(JCLLoggerFactory.java:69)
+  at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:249)
+  at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
+  subsequent lines omitted...</pre>
+
+
+    <p>As of SLF4J version 1.5.11, the code preempts the inevitable
+    stack overflow error by throwing an exception with details about
+    the actual cause of the problem.  This is deemed to be better than
+    leaving the user wondering about the reasons of the
+    <code>StackOverflowError</code>.
+    </p>
+
+    <p>For more background on this topic see <a
+    href="legacy.html">Bridging legacy APIs</a>.
+    </p>
+
+    <!-- ====================================================== -->
+
     <h3>
       <a name="no_static_mdc_binder"
       href="#no_static_mdc_binder">Failed to load class
diff --git a/slf4j-site/src/site/pages/legacy.html b/slf4j-site/src/site/pages/legacy.html
index a5ba376..fa8d54d 100644
--- a/slf4j-site/src/site/pages/legacy.html
+++ b/slf4j-site/src/site/pages/legacy.html
@@ -101,10 +101,10 @@
     
     <p>Please note that <em>jcl-over-slf4j.jar</em> and
     <em>slf4j-jcl.jar</em> cannot be deployed at the same time. The
-    former jar file will cause JCL to delegate the choice of the logging
-    system to SLF4J and the latter jar file will cause SLF4J to delegate
-    the choice of the logging system to JCL, resulting in an infinite
-    loop.
+    former jar file will cause JCL to delegate the choice of the
+    logging system to SLF4J and the latter jar file will cause SLF4J
+    to delegate the choice of the logging system to JCL, resulting in
+    an <a href="codes.html#jclDelegationLoop">infinite loop</a>.
     </p>
     
     
@@ -184,9 +184,10 @@
     <p>The presence of <em>slf4j-logj12.jar</em>, that is the log4j
     binding for SLF4J, will force all SLF4J calls to be delegated to
     log4j. The presence of <em>log4j-over-slf4j.jar</em> will in turn
-    delegate all log4j API calls to their SLF4J equivalents. If both are
-    present simultaneously, slf4j calls will be delegated to log4j, and
-    log4j calls redirected to SLF4j, resulting in an endless loop.
+    delegate all log4j API calls to their SLF4J equivalents. If both
+    are present simultaneously, slf4j calls will be delegated to
+    log4j, and log4j calls redirected to SLF4j, resulting in an <a
+    href="codes.html#log4jDelegationLoop">endless loop</a>.
     </p>
     
     <h3><a name="jul-to-slf4j" href="jul-to-slf4j">JUL to SLF4J</a></h3>
diff --git a/slf4j-site/src/site/pages/news.html b/slf4j-site/src/site/pages/news.html
index 8b04327..b5a8c71 100644
--- a/slf4j-site/src/site/pages/news.html
+++ b/slf4j-site/src/site/pages/news.html
@@ -27,7 +27,20 @@
 
    <hr noshade="noshade" size="1"/>
 
-  <h3>March xx, 2010 - Release of SLF4J 1.5.11</h3>
+  <h3>February 25th, 2010 - Release of SLF4J 1.5.11</h3>
+
+
+  <p>Users yet unfamiliar with SLF4J sometimes unknowingly place both
+  <em>log4j-over-slf4j.jar</em> and <em>slf4j-log4j12.jar</em>
+  simultanously on the class path causing stack overflow
+  errors. Simultaneously placing both <em>jcl-over-slf4j.jar</em> and
+  <em>slf4j-jcl.jar</em> on the class path, is another occurrence of
+  the same general problem. As of this version, SLF4J preempts the
+  inevitable stack overflow error by throwing an exception with
+  details about the actual cause of the problem. This is deemed to be
+  better than leaving the user wondering about the reasons of the
+  <code>StackOverflowError</code>.
+  </p>
 
   <p>Fixed <a href="http://bugzilla.slf4j.org/show_bug.cgi?id=168">bug
   168</a>. In case log4j-over-slf4j is used and a logback appender

-----------------------------------------------------------------------

Summary of changes:
 integration/pom.xml                                |    2 +-
 jcl-over-slf4j/pom.xml                             |    2 +-
 jcl104-over-slf4j/pom.xml                          |    2 +-
 jul-to-slf4j/pom.xml                               |    2 +-
 log4j-over-slf4j/pom.xml                           |    2 +-
 .../src/main/java/org/apache/log4j/Category.java   |    2 +
 .../java/org/apache/log4j/Log4jLoggerFactory.java  |   22 ++++-
 osgi-over-slf4j/pom.xml                            |    2 +-
 pom.xml                                            |    2 +-
 slf4j-api/pom.xml                                  |    2 +-
 .../src/main/java/org/slf4j/LoggerFactory.java     |    2 +-
 .../java/org/slf4j/impl/StaticLoggerBinder.java    |    2 +-
 slf4j-ext/pom.xml                                  |    2 +-
 slf4j-jcl/pom.xml                                  |    2 +-
 .../main/java/org/slf4j/impl/JCLLoggerFactory.java |   19 ++++
 .../java/org/slf4j/impl/StaticLoggerBinder.java    |    2 +-
 slf4j-jdk14/pom.xml                                |    2 +-
 .../java/org/slf4j/impl/StaticLoggerBinder.java    |    2 +-
 slf4j-log4j12/pom.xml                              |    2 +-
 .../java/org/slf4j/impl/StaticLoggerBinder.java    |    2 +-
 slf4j-migrator/pom.xml                             |    2 +-
 slf4j-nop/pom.xml                                  |    2 +-
 .../java/org/slf4j/impl/StaticLoggerBinder.java    |    2 +-
 slf4j-osgi-integration-test/pom.xml                |    2 +-
 slf4j-osgi-test-bundle/pom.xml                     |    2 +-
 slf4j-simple/pom.xml                               |    2 +-
 .../java/org/slf4j/impl/StaticLoggerBinder.java    |    2 +-
 slf4j-site/pom.xml                                 |    2 +-
 slf4j-site/src/site/pages/codes.html               |  110 ++++++++++++++++++-
 slf4j-site/src/site/pages/legacy.html              |   15 ++--
 slf4j-site/src/site/pages/news.html                |   15 +++-
 31 files changed, 193 insertions(+), 40 deletions(-)


hooks/post-receive
-- 
SLF4J: Simple Logging Facade for Java


More information about the slf4j-dev mailing list