Skip to content

SYNCOPE-1758 Avoid CAS servlet reinitialization in WA#1389

Closed
frhack wants to merge 1 commit into
apache:3_0_Xfrom
frhack:fix/SYNCOPE-1758-wa-cas-refresh-listener
Closed

SYNCOPE-1758 Avoid CAS servlet reinitialization in WA#1389
frhack wants to merge 1 commit into
apache:3_0_Xfrom
frhack:fix/SYNCOPE-1758-wa-cas-refresh-listener

Conversation

@frhack
Copy link
Copy Markdown

@frhack frhack commented May 17, 2026

This overrides CAS' configuration refresh listener in the WA starter so refresh still eagerly resolves beans, but no longer manually calls DispatcherServlet.init() without a ServletConfig.

The root cause is tracked upstream in CAS:
apereo/cas#8974

Syncope 3.0.x currently depends on CAS 6.6.x, and that CAS release line is EOL, so this keeps Syncope WA protected without waiting for a usable upstream CAS release on the 6.6 line.

Changes:

  • Add a WA-specific casConfigurationEventListener bean.
  • Preserve CAS refresh/rebind behavior.
  • Remove the special-case manual DispatcherServlet initialization.
  • Add a regression test verifying that dispatcherServlet is resolved but not reinitialized.

Tests:

  • /tmp/maven/apache-maven-3.9.11/bin/mvn -pl wa/starter -am -Dtest=WACasConfigurationEventListenerTest -Dsurefire.failIfNoSpecifiedTests=false test

Override CAS' configuration refresh listener in the WA starter so refresh still eagerly resolves beans but does not manually call DispatcherServlet.init() without ServletConfig.

This keeps Syncope WA protected while upstream CAS tracks the root cause in apereo/cas#8974.
@ilgrosso
Copy link
Copy Markdown
Member

3_0_X is EOL.
Please rebase your changes against 4_0_X or even 4_1_X, thanks.

Moreover, if this is your very first contribution to an ASF project, please ensure to submit your ICLA.

@Configuration(proxyBeanMethods = false)
public class WACasConfiguration {

@ConditionalOnMissingBean(name = "casConfigurationEventListener")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this bean definition into WAContext and remove this class.

FTR this class is going to be ignored by Spring runtime.

@frhack
Copy link
Copy Markdown
Author

frhack commented May 17, 2026

Reworked this on 4_1_X as requested, and moved the bean definition into WAContext per review feedback: #1390

Closing this 3_0_X PR as superseded.

@frhack
Copy link
Copy Markdown
Author

frhack commented May 17, 2026

Superseded by #1390.

@frhack frhack closed this May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants