Subject: [SOLVED] CAS 7.1.6 Automatic Configuration Reloading in Standalone Mode - Undocumented Property

51 views
Skip to first unread message

steven gladwell

unread,
Oct 5, 2025, 10:32:58 AMOct 5
to CAS Community

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:

properties
cas.events.core.track-configuration-modifications=true

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:

java
@Bean public InitializingBean casConfigurationWatchService( final ConfigurableApplicationContext applicationContext) { return BeanSupplier.of(InitializingBean.class) .when(BeanCondition.on("cas.events.core.track-configuration-modifications").isTrue() .given(applicationContext.getEnvironment())) .supply(() -> new CasConfigurationWatchService(applicationContext)) .otherwiseProxy() .get(); }

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.

Ocean Liu

unread,
Oct 6, 2025, 1:00:07 PM (14 days ago) Oct 6
to CAS Community, steven gladwell
Thanks for sharing! This is so helpful!
Reply all
Reply to author
Forward
0 new messages