This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/7.0.x by this push:
new d01c6a1 Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63249
d01c6a1 is described below
commit d01c6a1c94b48bff6a437a42d7bfdaa2dccfea72
Author: Mark Thomas
AuthorDate: Wed Mar 13 19:05:02 2019 +
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63249
Use a consistent log level (WARN) when logging the failure to register
or deregister a JMX Bean.
---
.../catalina/core/ApplicationFilterConfig.java | 31 ++
java/org/apache/catalina/core/StandardWrapper.java | 8 +++---
java/org/apache/catalina/loader/WebappLoader.java | 2 +-
java/org/apache/catalina/startup/HostConfig.java | 4 +--
webapps/docs/changelog.xml | 4 +++
5 files changed, 24 insertions(+), 25 deletions(-)
diff --git a/java/org/apache/catalina/core/ApplicationFilterConfig.java
b/java/org/apache/catalina/core/ApplicationFilterConfig.java
index c7af036..39c85ae 100644
--- a/java/org/apache/catalina/core/ApplicationFilterConfig.java
+++ b/java/org/apache/catalina/core/ApplicationFilterConfig.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -189,7 +189,7 @@ public final class ApplicationFilterConfig implements
FilterConfig, Serializable
@Override
public Enumeration getInitParameterNames() {
Map map = filterDef.getParameterMap();
-
+
if (map == null) {
return Collections.enumeration(emptyString);
}
@@ -262,9 +262,9 @@ public final class ApplicationFilterConfig implements
FilterConfig, Serializable
// Identify the class loader we will be using
String filterClass = filterDef.getFilterClass();
this.filter = (Filter) getInstanceManager().newInstance(filterClass);
-
+
initFilter();
-
+
return (this.filter);
}
@@ -284,7 +284,7 @@ public final class ApplicationFilterConfig implements
FilterConfig, Serializable
} else {
filter.init(this);
}
-
+
// Expose filter via JMX
registerJMX();
}
@@ -305,7 +305,7 @@ public final class ApplicationFilterConfig implements
FilterConfig, Serializable
void release() {
unregisterJMX();
-
+
if (this.filter != null) {
try {
if (Globals.IS_SECURITY_ENABLED) {
@@ -352,7 +352,7 @@ public final class ApplicationFilterConfig implements
FilterConfig, Serializable
instanceManager = new DefaultInstanceManager(null,
new HashMap>(),
context,
-getClass().getClassLoader());
+getClass().getClassLoader());
}
}
return instanceManager;
@@ -388,29 +388,26 @@ public final class ApplicationFilterConfig implements
FilterConfig, Serializable
}
try {
oname = new ObjectName(onameStr);
-Registry.getRegistry(null, null).registerComponent(this, oname,
-null);
+Registry.getRegistry(null, null).registerComponent(this, oname,
null);
} catch (Exception ex) {
-log.info(sm.getString("applicationFilterConfig.jmxRegisterFail",
+log.warn(sm.getString("applicationFilterConfig.jmxRegisterFail",
getFilterClass(), getFilterName()), ex);
}
}
-
+
+
private void unregisterJMX() {
// unregister this component
if (oname != null) {
try {
Registry.getRegistry(null, null).unregisterComponent(oname);
if (log.isDebugEnabled())
-log.debug(sm.getString(
-"applicationFilterConfig.jmxUnregister",
+
log.debug(sm.getString("applicationFilterConfig.jmxUnregister",
getFilterClass(), getFilterName()));
} catch(Exception ex) {
-log.error(sm.getString(
-"applicationFilterConfig.jmxUnregisterFail",
+
log.warn(sm.getString("applicationFilterConfig.jmxUnregisterFail",
getFilterClass(), getFilterName()), ex);
}
}
-
}
}
diff --git