Author: remy.maucherat(a)jboss.com
Date: 2008-01-15 13:09:01 -0500 (Tue, 15 Jan 2008)
New Revision: 393
Modified:
trunk/java/org/apache/catalina/loader/WebappClassLoader.java
trunk/webapps/docs/changelog.xml
Log:
- Add system property to be able to avoid system CL delegation if needed.
Modified: trunk/java/org/apache/catalina/loader/WebappClassLoader.java
===================================================================
--- trunk/java/org/apache/catalina/loader/WebappClassLoader.java 2008-01-14 11:04:56 UTC
(rev 392)
+++ trunk/java/org/apache/catalina/loader/WebappClassLoader.java 2008-01-15 18:09:01 UTC
(rev 393)
@@ -112,6 +112,9 @@
public static final boolean ENABLE_CLEAR_REFERENCES =
Boolean.valueOf(System.getProperty("org.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES",
"true")).booleanValue();
+ public static final boolean SYSTEM_CL_DELEGATION =
+
Boolean.valueOf(System.getProperty("org.apache.catalina.loader.WebappClassLoader.SYSTEM_CL_DELEGATION",
"true")).booleanValue();
+
protected class PrivilegedFindResource
implements PrivilegedAction {
@@ -1271,15 +1274,17 @@
// (0.2) Try loading the class with the system class loader, to prevent
// the webapp from overriding J2SE classes
- try {
- clazz = system.loadClass(name);
- if (clazz != null) {
- if (resolve)
- resolveClass(clazz);
- return (clazz);
+ if (SYSTEM_CL_DELEGATION) {
+ try {
+ clazz = system.loadClass(name);
+ if (clazz != null) {
+ if (resolve)
+ resolveClass(clazz);
+ return (clazz);
+ }
+ } catch (ClassNotFoundException e) {
+ // Ignore
}
- } catch (ClassNotFoundException e) {
- // Ignore
}
// (0.5) Permission to access this class when using a SecurityManager
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-01-14 11:04:56 UTC (rev 392)
+++ trunk/webapps/docs/changelog.xml 2008-01-15 18:09:01 UTC (rev 393)
@@ -128,6 +128,10 @@
<bug>43914</bug>: URLs in location headers should be encoded. Patch
provided by Ivan Todoroski. (markt)
</fix>
+ <fix>
+ Add org.apache.catalina.loader.WebappClassLoader.SYSTEM_CL_DELEGATION boolean
system
+ property to avoid systematic system CL delegation if needed. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
Show replies by date