Hi everyone,
I wanted to share a solution to an issue that cost me several hours of troubleshooting. If you're running CAS 7.1.x in standalone mode on an external servlet container (like Tomcat) and wondering why automatic configuration file watching isn't working, here's what I found.
The Problem: The CAS documentation states that in standalone mode with spring.cloud.config.enabled=false, CAS will automatically watch and monitor configuration files for changes. Despite having the cas-server-core-events-configuration dependency and running in standalone mode, file changes to /etc/cas/config/cas.properties weren't triggering automatic reloads. Manual refresh via /actuator/refresh worked fine, but automatic file watching did nothing.
The Solution: Add this property to your cas.properties:
How I Found It: While digging through the CAS source code, I stumbled on a test file (CasConfigurationEventListenerTests) that led me to CasCoreConfigurationWatchAutoConfiguration. The critical piece is in the bean definition:
The CasConfigurationWatchService bean only gets created when BeanCondition.on("cas.events.core.track-configuration-modifications").isTrue(). Without this property set to true, the file watcher never initializes.
The Documentation Gap: This required property is not mentioned anywhere in the "Configuration Management - Reloading Changes" documentation. The feature is disabled by default, and there's no indication in the docs that you need to explicitly enable it.
Verification: After adding the property and restarting, I can now see the automatic reload messages in the logs when I modify cas.properties. The file watcher works exactly as described in the documentation - but only with this undocumented flag enabled.
CAS Version: 7.1.6
Deployment: WAR to Tomcat 11
Profile: standalone
Hope this saves someone else the troubleshooting time. If anyone from the CAS team is reading this, it would be great to see this property documented in the Configuration Reloading section.