This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 08a515da0f Fix repeated logging when file cannot be found
08a515da0f is described below
commit 08a515da0f1e965f05986b907bdb46bebb9f6042
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Jul 6 10:33:08 2026 +0100
Fix repeated logging when file cannot be found
---
java/org/apache/catalina/users/MemoryUserDatabase.java | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/java/org/apache/catalina/users/MemoryUserDatabase.java b/java/org/apache/catalina/users/MemoryUserDatabase.java
index a6543d818d..f9caa30c58 100644
--- a/java/org/apache/catalina/users/MemoryUserDatabase.java
+++ b/java/org/apache/catalina/users/MemoryUserDatabase.java
@@ -17,7 +17,6 @@
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;
@@ -392,6 +391,9 @@ public class MemoryUserDatabase implements UserDatabase {
// Parse the XML input to load this database
digester.parse(resource.getInputStream());
} catch (IOException ioe) {
+ // The file doesn't exist / isn't accessible
+ // Set the last modified time to avoid repeated log messages
+ this.lastModified = 0;
log.error(sm.getString("memoryUserDatabase.fileNotFound", pathName));
} catch (Exception e) {
// Fail safe on error
@@ -644,11 +646,6 @@ public class MemoryUserDatabase implements UserDatabase {
writeLock.unlock();
}
}
- } 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);
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.