[tomcat] branch 7.0.x updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63249 Lifecycle

2019-03-14 Thread markt
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 1d3931d  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63249 
Lifecycle
1d3931d is described below

commit 1d3931d7ebb0ae278d7bbb09efdcada71ea7a935
Author: Mark Thomas 
AuthorDate: Thu Mar 14 12:12:47 2019 +

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63249 Lifecycle

Use a consistent log level (ERROR) when logging the LifecycleException
associated with the failure to start or stop a component.
---
 java/org/apache/catalina/core/StandardContext.java | 4 ++--
 java/org/apache/catalina/startup/HostConfig.java   | 3 +--
 java/org/apache/catalina/util/LifecycleBase.java   | 3 +--
 webapps/docs/changelog.xml | 5 +
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/core/StandardContext.java 
b/java/org/apache/catalina/core/StandardContext.java
index 0de8aad..d158e76 100644
--- a/java/org/apache/catalina/core/StandardContext.java
+++ b/java/org/apache/catalina/core/StandardContext.java
@@ -2280,7 +2280,7 @@ public class StandardContext extends ContainerBase
 oldNamingResources.stop();
 oldNamingResources.destroy();
 } catch (LifecycleException e) {
-log.warn("standardContext.namingResource.destroy.fail", e);
+
log.error(sm.getString("standardContext.namingResource.destroy.fail"), e);
 }
 }
 if (namingResources != null) {
@@ -2288,7 +2288,7 @@ public class StandardContext extends ContainerBase
 namingResources.init();
 namingResources.start();
 } catch (LifecycleException e) {
-log.warn("standardContext.namingResource.init.fail", e);
+
log.error(sm.getString("standardContext.namingResource.init.fail"), e);
 }
 }
 }
diff --git a/java/org/apache/catalina/startup/HostConfig.java 
b/java/org/apache/catalina/startup/HostConfig.java
index e977e8f..0c66896 100644
--- a/java/org/apache/catalina/startup/HostConfig.java
+++ b/java/org/apache/catalina/startup/HostConfig.java
@@ -1583,8 +1583,7 @@ public class HostConfig
 try {
 context.start();
 } catch (Exception e) {
-log.warn(sm.getString
- ("hostConfig.context.restart", app.name), e);
+log.error(sm.getString("hostConfig.context.restart", 
app.name), e);
 }
 }
 }
diff --git a/java/org/apache/catalina/util/LifecycleBase.java 
b/java/org/apache/catalina/util/LifecycleBase.java
index a4cd46b..faba205 100644
--- a/java/org/apache/catalina/util/LifecycleBase.java
+++ b/java/org/apache/catalina/util/LifecycleBase.java
@@ -259,8 +259,7 @@ public abstract class LifecycleBase implements Lifecycle {
 stop();
 } catch (LifecycleException e) {
 // Just log. Still want to destroy.
-log.warn(sm.getString(
-"lifecycleBase.destroyStopFail", toString()), e);
+log.error(sm.getString("lifecycleBase.destroyStopFail", 
toString()), e);
 }
 }
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index b7808c1..3256fba 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -93,6 +93,11 @@
 63249: Use a consistent log level (WARN) when
 logging the failure to register or deregister a JMX Bean. (markt)
   
+  
+63249: Use a consistent log level (ERROR) when
+logging the LifecycleException associated with the failure
+to start or stop a component. (markt)
+  
 
   
   


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



[tomcat] branch 7.0.x updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63249

2019-03-14 Thread markt
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