Integrate ActiveMQ Classic web console with Tomcat 9.x

63 Views Asked by At

I tried following ActiveMQ Classic official docs to put activemq-web-console.war into Tomcat webapps folder and activemq-all.jar into Tomcat lib, but web console can't be started.

  1. I tried Tomcat 5.5/8.0/9.0, with ActiveMQ Classic 5.15/5.18/6.0.1, report listeners failed to start problem
  2. I tried Tomcat lower than 5.5 with ActiveMQ 5.10, report exception while processing this request

Preconfigured with ActiveMQ Classic, and Tomcat as following:

  1. ActiveMQ Classic with JMX, verifed working with JConsole env:
    ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port=11099 "
    ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_CONF}/jmx.password"
    ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_CONF}/jmx.access"
    ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"
    ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"
    ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Djava.rmi.server.hostname=x.x.x.x"
    ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.authenticate=false"
    
  2. catalina.sh
    JAVA_OPTS="-Dwebconsole.type=properties -Dwebconsole.jms.url=tcp://x.x.x.x:61616 -Dwebconsole.jmx.url=service:jmx:rmi:///jndi/rmi://x.x.x.x:11099/jmxrmi"
    

Has anybody tried with a newer version with a successful deployment?

1

There are 1 best solutions below

2
Tan Qikun On

1.ActiveMQ 5.18.3 + Tomcat 9.0.84

2.JDK-18 required

3.Enable activeMQ JMX-192.168.1.1

  • useJmx="true" (conf/activemq.xml, broker element)

  • JMX parameter change (bin/env)

    ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port=11099 " ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=${ACTIVEMQ_CONF}/jmx.password" ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=${ACTIVEMQ_CONF}/jmx.access" ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false" ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote" ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote" ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.authenticate=false" ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Djava.rmi.server.hostname=192.168.1.1"

4.Tomcat 9.0.84 server on another Computer-192.168.1.2

  1. download activemq-web-console.war, and activemq-all.jar from maven central repo
  2. place war and jars into right position*
  • step1: cp activemq-web-console.war into tomcat9.0.84/webapps/
  • step2: cp activemq-all-5.18.3.jar into tomcat9.0.84/lib
  1. copy missing jars to tomcat9.0.84/webapps/activemq-web-console/WEB-INF/lib (from apache-activemq-5.18.3.tar.gz, web/lib)
  • apache-jsp-8.5.70.jar
  • apache-jsp-9.4.53.v20201009.jar
  • apache-jstl-9.4.53.v20231009.jar
  • taglibs-standard-impl-1.2.5.jar
  • taglibs-standard-spec-1.2.5.jar
  1. change tomcat9.0.84/bin/catalina.sh
  • CATALINA_OPTS="$CATALINA_OPTS -Dwebconsole.type=properties -Dwebconsole.jms.url=tcp://192.168.1.1:61616 -Dwebconsole.jmx.url=service:jmx:rmi:///jndi/rmi://192.168.1.1:11099/jmxrmi"

if you put missing jars above step 3 into tomcat-9.0.84/lib, it will report 404

5.ActiveMQ and Tomcat on same server, works too

just change activemq and tomcat listening ip address