This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push:
new b1e47ba BZ 61484. Repeated log messages with missing tomcat-users.xml
b1e47ba is described below
commit b1e47bac680efa52ef88fd87f4cbf774adabae7b
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 778a1a2..7c81f11 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.OutputStreamWriter;
@@ -683,6 +684,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 66a1629..cf486e2 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -84,6 +84,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]