Skip to content

Add tests to verify tomcat functions properly when clustering JARs are not present at runtime - #1038

Open
csutherl wants to merge 1 commit into
apache:mainfrom
csutherl:no-clustering-tests
Open

Add tests to verify tomcat functions properly when clustering JARs are not present at runtime#1038
csutherl wants to merge 1 commit into
apache:mainfrom
csutherl:no-clustering-tests

Conversation

@csutherl

@csutherl csutherl commented Aug 8, 2026

Copy link
Copy Markdown
Member

This change follows up on 91ac751 and a few other recent commits which make cluster classloading fully dynamic by using reflection to handle clustering classes that are missing at runtime. These tests verify that tomcat work correctly when catalina-ha.jar and catalina-tribes.jar are not present using filtering classloaders to simulate that environment.

The tests cover:

  • Catalina startup: Tomcat starts and serves requests when clustering classes are unavailable (addClusterRuleSet() logs instead of failing)
  • sessionsList.jsp: The Manager app sessions page compiles and renders without clustering, exercising the reflection-based fallback from 91ac751
  • StandardEngineSF/StandardHostSF: StoreConfig classes load without error; clusterValveClass fields are null when clustering is absent
  • StoreRegistry.getInterfaces(): Returns only the 10 core interfaces (no clustering interfaces) when clustering classes are not on the classpath

Each test uses a custom classloader (NoClusterClassLoader or StoreConfigIsolatingClassLoader) that throws a ClassNotFoundException for org.apache.catalina.ha.* and org.apache.catalina.tribes.* packages.

They're just a tests but I'm submitting this PR for some feedback since it's a bit of a hacky solution before committing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@csutherl
csutherl force-pushed the no-clustering-tests branch from 05478e5 to 28bc4fd Compare August 8, 2026 02:28
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.

1 participant