fix(deps): declare activemq-jaas explicitly (broker declares it as optional) - #217
Merged
Conversation
…tional) activemq-broker-5.16.8.pom declares activemq-jaas as <optional>true</optional>, so Maven never pulls it in transitively. The org.apache.activemq.jaas.GroupPrincipal class lives in activemq-jaas-5.16.8.jar (not in activemq-broker-5.16.8.jar), so as soon as the SimpleAuthenticationPlugin(List<?>) constructor is exercised, the JVM throws: NoClassDefFoundError: org/apache/activemq/jaas/GroupPrincipal This was a latent issue under the T2.2 hardening (#166). The <simpleAuthenticationPlugin anonymousAccessAllowed="false"/> block did not call the List ctor (it constructed the plugin with the no-arg ctor, which doesn't reference GroupPrincipal), so the missing class was never observed. PR #215 changed the config to <users><authenticationUser .../></users>, which forces the List ctor, which surfaces the missing class. The WebUI module's pom declares dependencies on activemq-broker, activemq-client, activemq-kahadb-store, activemq-spring, activemq-jms-pool -- but not activemq-jaas. The root pom's dependencyManagement block is missing activemq-jaas too. Maven respects <optional>true</optional> and does not transitively include optional deps, so the jar is never resolved, downloaded, or copied to WEB-INF/lib/. Fix has two parts: 1. Add activemq-jaas to the root pom's dependencyManagement (with version pinned to ${activemq.version} to match the other 5.16.8 entries). 2. Add activemq-jaas to WebUI/pom.xml as a runtime dependency. activemq-jaas-5.16.8.jar is ~38KB; the runtime cost is negligible. Refs #216 > Co-Authored by Mavis Mavis-Code using MiniMax-M3 with agent mavis.
natechadwick
approved these changes
Sep 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
activemq-broker-5.16.8.pomdeclaresactivemq-jaasas<optional>true</optional>, so Maven never pulls it in transitively.org.apache.activemq.jaas.GroupPrincipallives inactivemq-jaas-5.16.8.jar(not inactivemq-broker-5.16.8.jar), so as soon as theSimpleAuthenticationPlugin(List<?>)constructor is exercised, the JVM throwsNoClassDefFoundError: org/apache/activemq/jaas/GroupPrincipal.Why it surfaces now (and not earlier)
The T2.2 hardening (#166) used
<simpleAuthenticationPlugin anonymousAccessAllowed="false"/>with no users, so the plugin was constructed with the no-arg ctor (noGroupPrincipalreference). PR #215 changed the config to<users><authenticationUser .../></users>, which forces theListctor, which referencesGroupPrincipal— surfacing the missing jar.The class was always missing from the install; the previous T2.2 config just happened not to exercise it.
Diff
pom.xml:<dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-jms-pool</artifactId> <version>${activemq.version}</version> </dependency> + <dependency> + <groupId>org.apache.activemq</groupId> + <artifactId>activemq-jaas</artifactId> + <version>${activemq.version}</version> + </dependency> <dependency> <groupId>commons-digester</groupId> <artifactId>commons-digester</artifactId> <version>1.8.1</version> </dependency>WebUI/pom.xml:<dependency> <groupId>org.apache.activemq</groupId> <artifactId>activemq-jms-pool</artifactId> </dependency> + <dependency> + <groupId>org.apache.activemq</groupId> + <artifactId>activemq-jaas</artifactId> + </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> </dependency>Verification
After the rebuilt WebUI WAR is deployed:
unzip -l WebUI/target/<webui>-<ver>/WEB-INF/lib/activemq-jaas-5.16.8.jar | grep GroupPrincipal— present.grep -c "NoClassDefFoundError" .../server.log— 0grep -c "Failed to load: class path resource \[activemq.xml\]" ...— 0grep -c "Could not refresh JMS Connection" ...— 0 (JMS listeners reach steady state)For an immediate install-only fix (no rebuild), I already downloaded
activemq-jaas-5.16.8.jarfrom Maven Central and copied it to~/installs/cms-818/jetty/base/webapps/Rhythmyx/WEB-INF/lib/activemq-jaas-5.16.8.jarso a restart picks it up immediately. The source PR is for the long-term fix so the next build doesn't need the manual copy.Refs #216