tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1479175 - in /tomcat/trunk/java/org/apache/catalina/loader: LocalStrings.properties WebappClassLoader.java
Date Sat, 04 May 2013 21:00:52 GMT
Author: markt
Date: Sat May  4 20:59:07 2013
New Revision: 1479175

URL: http://svn.apache.org/r1479175
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54906
Better error message for ConcurrentModificationException when checking for memory leaks and
continue with remaining checks.
Based on a patch by NateC.

Modified:
    tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties
    tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java

Modified: tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties?rev=1479175&r1=1479174&r2=1479175&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties (original)
+++ tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties Sat May  4 20:59:07
2013
@@ -30,6 +30,7 @@ webappClassLoader.checkThreadLocalsForLe
 webappClassLoader.checkThreadLocalsForLeaksDebug=The web application [{0}] created a ThreadLocal
with key of type [{1}] (value [{2}]). The ThreadLocal has been correctly set to null and the
key will be removed by GC.
 webappClassLoader.checkThreadLocalsForLeaksFail=Failed to check for ThreadLocal references
for web application [{0}]
 webappClassLoader.checkThreadsHttpClient=Found HttpClient keep-alive thread using web application
class loader. Fixed by switching thread to the parent class loader.
+webappClassLoader.loadedByThisOrChildFail=Failed to fully check the entries in an instance
of [{0}] for potential memory leaks in context [{1}]
 webappClassLoader.stopThreadFail=Failed to terminate thread named [{0}] for web application
[{1}]
 webappClassLoader.stopTimerThreadFail=Failed to terminate TimerThread named [{0}] for web
application [{1}]
 webappClassLoader.validationErrorJarPath=Unable to validate JAR entry with name {0}

Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=1479175&r1=1479174&r2=1479175&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java (original)
+++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Sat May  4 20:59:07
2013
@@ -41,6 +41,7 @@ import java.security.PrivilegedAction;
 import java.security.ProtectionDomain;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.ConcurrentModificationException;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -2312,11 +2313,17 @@ public class WebappClassLoader
 
         if (o instanceof Collection<?>) {
             Iterator<?> iter = ((Collection<?>) o).iterator();
-            while (iter.hasNext()) {
-                Object entry = iter.next();
-                if (loadedByThisOrChild(entry)) {
-                    return true;
+            try {
+                while (iter.hasNext()) {
+                    Object entry = iter.next();
+                    if (loadedByThisOrChild(entry)) {
+                        return true;
+                    }
                 }
+            } catch (ConcurrentModificationException e) {
+                log.warn(sm.getString(
+                        "webappClassLoader", clazz.getName(), getContextName()),
+                        e);
             }
         }
         return false;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message