You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/03/14 11:09:59 UTC
[tomcat] branch 7.0.x updated: Fix
https://bz.apache.org/bugzilla/show_bug.cgi?id=63249
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 <ma...@apache.org>
AuthorDate: Wed Mar 13 19:05:02 2019 +0000
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<String> getInitParameterNames() {
Map<String,String> 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<String, Map<String, String>>(),
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 a/java/org/apache/catalina/core/StandardWrapper.java b/java/org/apache/catalina/core/StandardWrapper.java
index 05f8f8a..774d393 100644
--- a/java/org/apache/catalina/core/StandardWrapper.java
+++ b/java/org/apache/catalina/core/StandardWrapper.java
@@ -1080,11 +1080,9 @@ public class StandardWrapper extends ContainerBase
try {
jspMonitorON = new ObjectName(oname.toString());
- Registry.getRegistry(null, null)
- .registerComponent(instance, jspMonitorON, null);
- } catch( Exception ex ) {
- log.info("Error registering JSP monitoring with jmx " +
- instance);
+ Registry.getRegistry(null, null).registerComponent(instance, jspMonitorON, null);
+ } catch (Exception ex) {
+ log.warn("Error registering JSP monitoring with jmx " + instance);
}
}
}
diff --git a/java/org/apache/catalina/loader/WebappLoader.java b/java/org/apache/catalina/loader/WebappLoader.java
index a639855..6c87beb 100644
--- a/java/org/apache/catalina/loader/WebappLoader.java
+++ b/java/org/apache/catalina/loader/WebappLoader.java
@@ -696,7 +696,7 @@ public class WebappLoader extends LifecycleMBeanBase
+ contextName + ",host=" + ctx.getParent().getName());
Registry.getRegistry(null, null).unregisterComponent(cloname);
} catch (Exception e) {
- log.error("LifecycleException ", e);
+ log.warn("LifecycleException ", e);
}
classLoader = null;
diff --git a/java/org/apache/catalina/startup/HostConfig.java b/java/org/apache/catalina/startup/HostConfig.java
index 2b4fa2c..e977e8f 100644
--- a/java/org/apache/catalina/startup/HostConfig.java
+++ b/java/org/apache/catalina/startup/HostConfig.java
@@ -1735,7 +1735,7 @@ public class HostConfig
Registry.getRegistry(null, null).registerComponent
(this, oname, this.getClass().getName());
} catch (Exception e) {
- log.error(sm.getString("hostConfig.jmx.register", oname), e);
+ log.warn(sm.getString("hostConfig.jmx.register", oname), e);
}
if (!appBase().isDirectory()) {
@@ -1763,7 +1763,7 @@ public class HostConfig
try {
Registry.getRegistry(null, null).unregisterComponent(oname);
} catch (Exception e) {
- log.error(sm.getString("hostConfig.jmx.unregister", oname), e);
+ log.warn(sm.getString("hostConfig.jmx.unregister", oname), e);
}
}
oname = null;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index de7aeca..0cc0c15 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -84,6 +84,10 @@
<bug>63246</bug>: Fix a potential <code>NullPointerException</code> when
calling <code>AsyncContext.dispatch()</code>. (markt)
</fix>
+ <fix>
+ <bug>63249</bug>: Use a consistent log level (<code>WARN</code>) when
+ logging the failure to register or deregister a JMX Bean. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org