wildflyjava-11amqpactivemq-artemis

Exception javax/management/openmbean/CompositeData using AMQP-client in WildFly built-in ActiveMQ Artemis server


I've been using a QPID C++ client (AMQP) with WildFly 23.0.1 for a while and there is no issues with it. Now I want to use a newer version of WildFly (30+) and found a major problem: QPID client is not able to get or put message in queue with warnings in WildFly log:

standalone.sh[121985]: JAVA_OPTS already set in environment; overriding default settings with values: -Xmx8g
standalone.sh[121985]: =========================================================================
standalone.sh[121985]:   JBoss Bootstrap Environment
standalone.sh[121985]:   JBOSS_HOME: /opt/wildfly-31.0.0.Final
standalone.sh[121985]:   JAVA: java
standalone.sh[121985]:   JAVA_OPTS:  -Djdk.serialFilter="maxbytes=10485760;maxdepth=128;maxarray=100000;maxrefs=300000" -Xmx8g  --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.url.ldap=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.url.ldaps=ALL-UNNAMED --add-exports=jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED --add-opens=java.base/com.sun.net.ssl.internal.ssl=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED
standalone.sh[121985]: =========================================================================
standalone.sh[122082]:  WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 76) WFLYTX0013: The node-identifier attribute on the /subsystem=transactions is set to the default value. This is a danger for environments running multiple servers. Please make sure the attribute value is unique.
standalone.sh[122082]:  WARN  [org.wildfly.extension.elytron] (MSC service thread 1-6) WFLYELY00023: KeyStore file '/var/stmq/wildfly-31/configuration/application.keystore' does not exist. Used blank.
standalone.sh[122082]:  WARN  [org.wildfly.extension.elytron] (MSC service thread 1-6) WFLYELY01084: KeyStore /var/stmq/wildfly-31/configuration/application.keystore not found, it will be auto-generated on first use with a self-signed certificate for host localhost
standalone.sh[122082]:  WARN  [org.apache.activemq.artemis.core.client] (Thread-110) AMQ212037: Connection failure to /127.0.0.1:39496 has been detected: javax/management/openmbean/CompositeData [code=GENERIC_EXCEPTION]
standalone.sh[122082]:  WARN  [org.apache.activemq.artemis.core.server] (Thread-110) AMQ222061: Client connection failed, clearing up resources for session 16f2cfc6-da04-11ee-aae6-005056b82d10
standalone.sh[122082]:  WARN  [org.apache.activemq.artemis.core.server] (Thread-110) AMQ222107: Cleared up resources for session 16f2cfc6-da04-11ee-aae6-005056b82d10

It seems that org.apache.activemq.artemis.client and org.apache.activemq.artemis.protocol.amqp modules are missing javax.management.openmbean.CompositeData class dependency, but JAVA_OPTS has --add-opens=java.management/javax.management=ALL-UNNAMED clause when server is starting.

Messaging-subsystem is configured in simple - non-suspicious way:

<subsystem xmlns="urn:jboss:domain:messaging-activemq:16.0">
    <server name="amqserver">
        <security elytron-domain="ApplicationDomain"/>
        <management jmx-enabled="true"/>
        <security-setting name="#">
            <role name="amqapp" send="true" consume="true"/>
        </security-setting>
        <address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" auto-create-addresses="false"/>
        <in-vm-connector name="in-vm" server-id="1"/>
        <!--<remote-acceptor name="activemq" socket-binding="61616"/>-->
        <in-vm-acceptor name="in-vm" server-id="1"/>
        <acceptor name="amqp-acceptor" socket-binding="61616" factory-class="org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory">
           <param name="protocols" value="AMQP,CORE"/>
           <param name="connection-ttl" value="30000"/>
        </acceptor>
        <jms-queue name="ExpiryQueue" entries="java:/jms/queues/ExpiryQueue"/>
        <jms-queue name="DLQ" entries="java:/jms/queues/DLQ"/>
        <jms-queue name="AMQP.IN" entries="java:/jms/queues/AMQP.IN"/>
        <jms-queue name="AMQP.OUT" entries="java:/jms/queues/AMQP.OUT"/>
        <connection-factory name="in-vm" entries="java:/ConnectionFactory" connectors="in-vm"/>
    </server>
</subsystem>

Editing any of modules.xml inside $WILDFLY_HOME/modules/system/layers/base/org/apache/artemis/* gives another boot-error:

AMQ224097: Failed to start server: java.lang.NoClassDefFoundError: javax/management/openmbean/CompositeData

How can I add module javax.management to WildFly environment, and which version should I use?

PS: WildFly running via openjdk version "11.0.17" 2022-10-18 LTS.


Solution

  • Adding <module name="java.management"/> to the dependencies of the module org.apache.activemq.artemis.protocol.amqp fixes this. I've created https://issues.redhat.com/browse/WFLY-19089 to track this