Uploaded image for project: 'ActiveMQ Artemis'
  1. ActiveMQ Artemis
  2. ARTEMIS-3278

Artemis (classloader) is unable to find jgroups configuration file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 2.17.0
    • None
    • Broker, Configuration
    • None

    Description

      The artemis broker is unable to use the jgroups configuration as per documented. This issue is present both running on a system directly, or running within docker. Will explain docker approach. I have tested this on my machine, and a teammates machine.

       

      Steps to Reproduce (high level, detailed below):

      1. In artemis-docker directory, build dockerfile
      2. Add jgroups config to container
      3. modify broker xml to reference container
      4. restart broker (config is not reloaded)
      5. broker crashes

       

      An exception is thrown by the config loader: https://github.com/apache/activemq-artemis/blob/e364961c8f035613f3ce4e3bdb3430a17efb0ffd/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/JGroupsFileBroadcastEndpoint.java#L42

      despite the classpath supposedly having been altered: https://github.com/apache/activemq-artemis/blob/main/artemis-boot/src/main/java/org/apache/activemq/artemis/boot/Artemis.java#L82

      I have tried this by manually adding the folder to the classpath in startup args just in case (as in the profile):
      -Xbootclasspath/a:$ARTEMIS_INSTANCE_ETC

       

      ./prepare-docker.sh --from-release --artemis-version 2.17.0
      cd _TMP_/artemis/2.17.0
      docker build -f ./docker/Dockerfile-adoptopenjdk-11 -t artemis-adoptopenjdk-11 .
      docker run --name artemis -d -P -e EXTRA_ARGS="--clustered" artemis-adoptopenjdk-11:latest
      docker cp jgroups-file-ping.xml artemis:/var/lib/artemis-instance/etc/
      docker exec -u root -it artemis bash
      
      # in container edit using your editor of choice
      mkdir /etc/jgroups && chmod -R 777 /etc/jgroups
      apt-get update && apt-get install -y vim
      vim etc/broker.xml
      
      # modify and replace xml elements:
      
      <broadcast-groups>
       <broadcast-group name="jgroups-broadcast-group"> 
       <broadcast-period>2000</broadcast-period> 
       <jgroups-file>/var/lib/artemis/instance/etc/jgroups-file-ping.xml</jgroups-file> 
       <jgroups-channel>activemq_broadcast_channel</jgroups-channel> 
       <connector-ref>artemis</connector-ref> 
       </broadcast-group> 
      </broadcast-groups>
      <discovery-groups>
       <discovery-group name="jgroups-discovery-group">
       <jgroups-file>/var/lib/artemis/instance/etc/jgroups-file-ping.xml</jgroups-file>
       <jgroups-channel>activemq_broadcast_channel</jgroups-channel>
       <refresh-timeout>10000</refresh-timeout>
       </discovery-group>
      </discovery-groups>
      <cluster-connections>
       <cluster-connection name="my-cluster">
       <connector-ref>artemis</connector-ref>
       <message-load-balancing>ON_DEMAND</message-load-balancing>
       <max-hops>0</max-hops>
       <discovery-group-ref discovery-group-name="jgroups-discovery-group"/>
       </cluster-connection>
      </cluster-connections>
      
      # exit. force reload
      docker stop artemis
      docker restart artemis && docker attach artemis
      

       

      Expected: Broker then starts with jgroups discovery enabled using the aforementioned filepine directory or complains about invalid configuration

      Actual: Broker fails to start:

      2021-05-03 11:46:43,829 INFO  [org.apache.activemq.artemis.core.server] AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=true,journalDirectory=data/journal,bindingsDirectory=data/bindings,largeMessagesDirectory=data/large-messages,pagingDirectory=data/paging)2021-05-03 11:46:43,829 INFO  [org.apache.activemq.artemis.core.server] AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=true,journalDirectory=data/journal,bindingsDirectory=data/bindings,largeMessagesDirectory=data/large-messages,pagingDirectory=data/paging)2021-05-03 11:46:43,870 INFO  [org.apache.activemq.artemis.core.server] AMQ221013: Using NIO Journal2021-05-03 11:46:43,936 INFO  [org.apache.activemq.artemis.core.server] AMQ221057: Global Max Size is being adjusted to 1/2 of the JVM max size (-Xmx). being defined as 1,073,741,8242021-05-03 11:46:43,953 ERROR [org.apache.activemq.artemis.core.server] AMQ224000: Failure in initialisation: java.lang.RuntimeException: couldn't find JGroups configuration etc/jgroups-file-ping.xml at org.apache.activemq.artemis.api.core.JGroupsFileBroadcastEndpoint.createChannel(JGroupsFileBroadcastEndpoint.java:43) [artemis-core-client-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.api.core.jgroups.JChannelManager.getJChannel(JChannelManager.java:74) [artemis-core-client-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.api.core.JGroupsBroadcastEndpoint.initChannel(JGroupsBroadcastEndpoint.java:108) [artemis-core-client-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.api.core.JGroupsFileBroadcastEndpointFactory.createBroadcastEndpoint(JGroupsFileBroadcastEndpointFactory.java:31) [artemis-core-client-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.core.server.cluster.impl.BroadcastGroupImpl.<init>(BroadcastGroupImpl.java:89) [artemis-server-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.core.server.cluster.ClusterManager.createBroadcastGroup(ClusterManager.java:655) [artemis-server-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.core.server.cluster.ClusterManager.deployBroadcastGroup(ClusterManager.java:646) [artemis-server-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.core.server.cluster.ClusterManager.deploy(ClusterManager.java:241) [artemis-server-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.initialisePart1(ActiveMQServerImpl.java:3087) [artemis-server-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.core.server.impl.LiveOnlyActivation.run(LiveOnlyActivation.java:68) [artemis-server-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.internalStart(ActiveMQServerImpl.java:635) [artemis-server-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.start(ActiveMQServerImpl.java:559) [artemis-server-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.integration.FileBroker.start(FileBroker.java:64) [artemis-cli-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:115) [artemis-cli-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:154) [artemis-cli-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:102) [artemis-cli-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:129) [artemis-cli-2.17.0.jar:2.17.0] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java.base:] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [java.base:] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [java.base:] at java.base/java.lang.reflect.Method.invoke(Method.java:566) [java.base:] at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:134) [artemis-boot.jar:2.17.0] at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:50) [artemis-boot.jar:2.17.0]
      2021-05-03 11:46:43,957 INFO  [org.apache.activemq.artemis.core.server] AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.17.0 [147dda9eb260.ant.amazon.com, nodeID=a965a516-ac3f-11eb-a290-0050b68c6d16]2021-05-03 11:46:44,214 INFO  [org.apache.activemq.hawtio.branding.PluginContextListener] Initialized activemq-branding plugin2021-05-03 11:46:44,274 INFO  [org.apache.activemq.hawtio.plugin.PluginContextListener] Initialized artemis-plugin plugin2021-05-03 11:46:44,586 INFO  [io.hawt.HawtioContextListener] Initialising hawtio services2021-05-03 11:46:44,620 INFO  [io.hawt.system.ConfigManager] Configuration will be discovered via system properties2021-05-03 11:46:44,622 INFO  [io.hawt.jmx.JmxTreeWatcher] Welcome to Hawtio 2.11.02021-05-03 11:46:44,627 INFO  [io.hawt.web.auth.AuthenticationConfiguration] Starting hawtio authentication filter, JAAS realm: "activemq" authorized role(s): "amq" role principal classes: "org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal"2021-05-03 11:46:44,651 INFO  [io.hawt.web.proxy.ProxyServlet] Proxy servlet is disabled2021-05-03 11:46:44,658 INFO  [io.hawt.web.servlets.JolokiaConfiguredAgentServlet] Jolokia overridden property: [key=policyLocation, value=file:/Volumes/workplace/AmazonMqArtemisPrototyping/src/AmazonMqArtemisPrototyping/bin/broker/artemis/etc/jolokia-access.xml]2021-05-03 11:46:44,785 INFO  [org.apache.activemq.artemis] AMQ241001: HTTP Server started at http://localhost:81612021-05-03 11:46:44,785 INFO  [org.apache.activemq.artemis] AMQ241002: Artemis Jolokia REST API available at http://localhost:8161/console/jolokia2021-05-03 11:46:44,786 INFO  [org.apache.activemq.artemis] AMQ241004: Artemis Console available at http://localhost:8161/console2021-05-03 11:46:44,787 ERROR [org.apache.activemq.artemis.core.server] AMQ224068: Unable to stop component: org.apache.activemq.artemis.core.server.management.impl.ManagementServiceImpl: java.lang.NullPointerException at org.apache.activemq.artemis.core.server.management.impl.ManagementServiceImpl.unregisterServer(ManagementServiceImpl.java:247) [artemis-server-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:1307) [artemis-server-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:1166) [artemis-server-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:1138) [artemis-server-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.stop(ActiveMQServerImpl.java:949) [artemis-server-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.integration.FileBroker.stop(FileBroker.java:92) [artemis-cli-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.cli.commands.Run.stop(Run.java:201) [artemis-cli-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.cli.commands.Run.execute(Run.java:131) [artemis-cli-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.cli.Artemis.internalExecute(Artemis.java:154) [artemis-cli-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:102) [artemis-cli-2.17.0.jar:2.17.0] at org.apache.activemq.artemis.cli.Artemis.execute(Artemis.java:129) [artemis-cli-2.17.0.jar:2.17.0] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java.base:] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [java.base:] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [java.base:] at java.base/java.lang.reflect.Method.invoke(Method.java:566) [java.base:] at org.apache.activemq.artemis.boot.Artemis.execute(Artemis.java:134) [artemis-boot.jar:2.17.0] at org.apache.activemq.artemis.boot.Artemis.main(Artemis.java:50) [artemis-boot.jar:2.17.0]
      2021-05-03 11:46:44,826 INFO  [io.hawt.web.auth.AuthenticationFilter] Destroying hawtio authentication filter2021-05-03 11:46:44,827 INFO  [io.hawt.HawtioContextListener] Destroying hawtio services2021-05-03 11:46:44,854 INFO  [org.apache.activemq.hawtio.plugin.PluginContextListener] Destroyed artemis-plugin plugin2021-05-03 11:46:44,863 INFO  [org.apache.activemq.hawtio.branding.PluginContextListener] Destroyed activemq-branding plugin2021-05-03 11:46:44,892 INFO  [org.apache.activemq.artemis.core.server] AMQ221002: Apache ActiveMQ Artemis Message Broker version 2.17.0 [a965a516-ac3f-11eb-a290-0050b68c6d16] stopped, uptime 1.073 seconds

       Reproduction steps on local machine:

      mkdir -p ./bin/artemis
      tar xzf ./bin/artemis.tar.gz --directory ./bin/artemis --strip 1
      
      mkdir -p bin/broker/artemis
      bin/artemis/bin/artemis create --user artemis --password password --allow-anonymous --relax-jolokia --clustered --host hostname bin/broker/artemis
      
      ...
      
      --cluster-user: is a mandatory property!
      Please provide the username:
      cluster-user
      --cluster-password: is mandatory with this configuration:
      Please enter the password:
      password
      
      # edit xml as above
      
      ./bin/broker/artemis/bin/artemis run

      Attachments

        1. jgroups-file-ping.xml
          3 kB
          Étienne Hossack

        Activity

          People

            Unassigned Unassigned
            ehossack Étienne Hossack
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: