Skip to content

fix(deps): declare activemq-jaas explicitly (broker declares it as optional) - #217

Merged
natechadwick merged 1 commit into
mainfrom
bugfix/216-activemq-jaas-dep
Sep 9, 2026
Merged

fix(deps): declare activemq-jaas explicitly (broker declares it as optional)#217
natechadwick merged 1 commit into
mainfrom
bugfix/216-activemq-jaas-dep

Conversation

@natechadwick-intsof

Copy link
Copy Markdown
Collaborator

Summary

activemq-broker-5.16.8.pom declares activemq-jaas as <optional>true</optional>, so Maven never pulls it in transitively. org.apache.activemq.jaas.GroupPrincipal 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.

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 (no GroupPrincipal reference). PR #215 changed the config to <users><authenticationUser .../></users>, which forces the List ctor, which references GroupPrincipal — 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 — 0
  • grep -c "Failed to load: class path resource \[activemq.xml\]" ... — 0
  • grep -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.jar from Maven Central and copied it to ~/installs/cms-818/jetty/base/webapps/Rhythmyx/WEB-INF/lib/activemq-jaas-5.16.8.jar so 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

Co-Authored by Mavis Mavis-Code using MiniMax-M3 with agent mavis.

…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
natechadwick merged commit f0bb485 into main Sep 9, 2026
3 checks passed
@natechadwick
natechadwick deleted the bugfix/216-activemq-jaas-dep branch September 9, 2026 00:18
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.

fix(deps): declare activemq-jaas explicitly (broker declares it as optional)

2 participants