Author: sco...@google.com Date: Wed Mar 25 05:31:10 2009 New Revision: 5077
Modified: releases/1.6/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java Log: Ensure that system classes are always loaded from the external classloader and never copied into the WebAppClassLoader. Issue: #3496 Review by: tobyr (TBR), jat Modified: releases/1.6/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java ============================================================================== --- releases/1.6/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java (original) +++ releases/1.6/dev/core/src/com/google/gwt/dev/shell/jetty/JettyLauncher.java Wed Mar 25 05:31:10 2009 @@ -255,6 +255,17 @@ @Override public URL findResource(String name) { + // Specifically for META-INF/services/javax.xml.parsers.SAXParserFactory + String checkName = name; + if (checkName.startsWith("META-INF/services/")) { + checkName = checkName.substring("META-INF/services/".length()); + } + + // For system/server path, just try the outside world quietly. + if (isSystemPath(checkName)) { + return systemClassLoader.getResource(name); + } + // Always check this ClassLoader first. URL found = super.findResource(name); if (found != null) { @@ -267,17 +278,6 @@ return null; } - // Specifically for META-INF/services/javax.xml.parsers.SAXParserFactory - String checkName = name; - if (checkName.startsWith("META-INF/services/")) { - checkName = checkName.substring("META-INF/services/".length()); - } - - // For system/server path, just return it quietly. - if (isServerPath(checkName) || isSystemPath(checkName)) { - return found; - } - // Warn, add containing URL to our own ClassLoader, and retry the call. String warnMessage = "Server resource '" + name @@ -303,14 +303,17 @@ @Override protected Class<?> findClass(String name) throws ClassNotFoundException { + // For system/server path, just try the outside world quietly. + if (isSystemPath(name)) { + return systemClassLoader.loadClass(name); + } + try { return super.findClass(name); } catch (ClassNotFoundException e) { - } - - // For system/server path, just try the outside world quietly. - if (isServerPath(name) || isSystemPath(name)) { - return systemClassLoader.loadClass(name); + if (isServerPath(name)) { + throw e; + } } // See if the outside world has a URL for it. --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---