This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new a9a94e3 BZ 61484. Repeated log messages with missing tomcat-users.xml
a9a94e3 is described below
commit a9a94e394a73b74e3937056e2dbba628f0211dc6
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Mar 3 10:29:19 2020 +0000
BZ 61484. Repeated log messages with missing tomcat-users.xml
https://bz.apache.org/bugzilla/show_bug.cgi?id=64184
---
java/org/apache/catalina/users/MemoryUserDatabase.java | 6 ++++++
webapps/docs/changelog.xml | 5 +++++
2 files changed, 11 insertions(+)
diff --git a/java/org/apache/catalina/users/MemoryUserDatabase.java
b/java/org/apache/catalina/users/MemoryUserDatabase.java
index 45e846c..1f44202 100644
--- a/java/org/apache/catalina/users/MemoryUserDatabase.java
+++ b/java/org/apache/catalina/users/MemoryUserDatabase.java
@@ -17,6 +17,7 @@
package org.apache.catalina.users;
import java.io.File;
+import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -698,6 +699,11 @@ public class MemoryUserDatabase implements UserDatabase {
try {
// Can't close a uConn directly. Have to do it like this.
uConn.getInputStream().close();
+ } catch (FileNotFoundException fnfe) {
+ // The file doesn't exist.
+ // This has been logged above. No need to log again.
+ // Set the last modified time to avoid repeated log
messages
+ this.lastModified = 0;
} catch (IOException ioe) {
log.warn(sm.getString("memoryUserDatabase.fileClose",
pathname), ioe);
}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 75b8809..61dba28 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -91,6 +91,11 @@
support authentication persistence. Patch provided by Carsten Klein.
(markt)
</add>
+ <fix>
+ <bug>64184</bug>: Avoid repeated log messages if a
+ <code>MemoryUserDatabase</code> is configured but the specified
+ configuration file is missing. (markt)
+ </fix>
<add>
<bug>64189</bug>: Expose the web application version String as a
<code>ServletContext</code> attribute named
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]