This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new c71cb9d8e2 Fix repeated logging when file cannot be found
c71cb9d8e2 is described below
commit c71cb9d8e2e238c656d7cb996525df3b79cc6e83
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 740f17458a..7d2a527d2e 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
@@ -657,11 +659,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);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]