diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLog.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLog.java index 930a6f600c4..5601b520a40 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLog.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Slf4jLog.java @@ -37,7 +37,11 @@ public class Slf4jLog implements Logger } catch (ClassNotFoundException ex) { +<<<<<<< Updated upstream ex.printStackTrace(System.err); +======= + ex.printStackTrace(); +>>>>>>> Stashed changes throw new NoClassDefFoundError("org.slf4j.impl.StaticLoggerBinder"); } diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/LogTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/LogTest.java index 3f480108d32..8c82241b1be 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/LogTest.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/log/LogTest.java @@ -61,7 +61,6 @@ public class LogTest } @Test - @Ignore public void testNamedLogNamed_Slf4J() throws Exception { Log.setLog(new Slf4jLog()); diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Slf4jTestJarsRunner.java b/jetty-util/src/test/java/org/eclipse/jetty/util/log/Slf4jTestJarsRunner.java index d0cda690cbc..65639bc4858 100644 --- a/jetty-util/src/test/java/org/eclipse/jetty/util/log/Slf4jTestJarsRunner.java +++ b/jetty-util/src/test/java/org/eclipse/jetty/util/log/Slf4jTestJarsRunner.java @@ -26,6 +26,46 @@ public class Slf4jTestJarsRunner extends BlockJUnit4ClassRunner super(urls); } + @Override + protected synchronized Class loadClass(String name, boolean resolve) throws ClassNotFoundException + { + System.err.printf("[slf4j.cl] loadClass(%s)%n", name); + + ClassNotFoundException ex= null; + Class c = null; + try + { + c = this.findClass(name); + if ( resolve ) + { + resolveClass(c); + } + return c; + + } + catch (ClassNotFoundException e) + { + ex= e; + } + + if ( c == null ) + { + try + { + c = super.loadClass(name,resolve); + } + catch (ClassNotFoundException e) + { + ex= e; + } + } + + throw ex; + + } + + + @Override public Class loadClass(String name) throws ClassNotFoundException { @@ -100,6 +140,11 @@ public class Slf4jTestJarsRunner extends BlockJUnit4ClassRunner System.out.println("Classpath entry: " + url); } + for ( URL url : urls ) + { + System.out.println(url.toString()); + } + slf4jClassLoader = new Slf4jTestClassLoader(urls); } catch (MalformedURLException e)