Log a warning if a duplicate listener is ignored. Result of bug 44268.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 21 Jan 2008 21:14:57 +0000 (21:14 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 21 Jan 2008 21:14:57 +0000 (21:14 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@614012 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/core/LocalStrings.properties
java/org/apache/catalina/core/StandardContext.java

index 532a796..28f4eca 100644 (file)
@@ -69,6 +69,7 @@ standardContext.applicationListener=Error configuring application listener of cl
 standardContext.applicationSkipped=Skipped installing application listeners due to previous error(s)
 standardContext.badRequest=Invalid request path ({0}).
 standardContext.crlfinurl=The URL pattern "{0}" contains a CR or LF and so can never be matched.
+standardContext.duplicateListener=The listener "{0}" is already configured for this context. The duplicate definition has been ignored.
 standardContext.errorPage.error=Error page location {0} must start with a ''/''
 standardContext.errorPage.required=ErrorPage cannot be null
 standardContext.errorPage.warning=WARNING: Error page location {0} must start with a ''/'' in Servlet 2.4
index 109b29f..a4b7076 100644 (file)
@@ -1948,8 +1948,11 @@ public class StandardContext
         synchronized (applicationListeners) {
             String results[] =new String[applicationListeners.length + 1];
             for (int i = 0; i < applicationListeners.length; i++) {
-                if (listener.equals(applicationListeners[i]))
+                if (listener.equals(applicationListeners[i])) {
+                    log.info(sm.getString(
+                            "standardContext.duplicateListener",listener));
                     return;
+                }
                 results[i] = applicationListeners[i];
             }
             results[applicationListeners.length] = listener;