ActiveMQ 5.16.3 Windows and Hawtio Login Problems

788 Views Asked by At

I've installed Apache ActiveMQ 5.16.3 on my windows 10 laptop for testing purposes And i downloaded hawtio 2.13.3 as a webapp for monitoring.

Steps i did to install and configure :

  1. Downloaded ActiveMQ and extracted it to a folder
  2. Downloaded Hawtio and extracted it at ActiveMQ webapps folder
  3. Added Hawtio as a resource under jetty.xml file
  4. Added -dhawtio configurations under activemq file at bin folder
  5. Ran ActiveMQ service installer "InstallService.bat"
  6. Ran ActiveMQ Service and navigated to 127.0.0.1/admin
  7. ActiveMQ works , i now navigate to 127.0.0.1/hawtio
  8. I attempted logging in using the default user and password (admin,admin)
  9. I received an error stating my credentials are invalid

After attempting to login to hawtio web i notice this error in my activemq batch file

INFO  | qtp1675905101-41 | Hawtio login is using 1800 sec. HttpSession timeout
WARN  | qtp1675905101-41 | Login failed due to: No LoginModules configured for karaf

Did i miss something on the way?

Thanks,

1

There are 1 best solutions below

0
M4CHINE On

Okay,

For anyone else facing this weird problem , i solved the issue by myself after 3 days of searching for an answer.

Since ActiveMQ Is ran by a batch file from the /bin folder (C:\Active_MQ_Windows\apache-activemq-5.16.3\bin , to be more percise)

by activemq.bat , we need to add the following lines to the batch file.

The following lines are :

 if "%ACTIVEMQ_OPTS%" == "" set ACTIVEMQ_OPTS=-Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config="%ACTIVEMQ_CONF%\login.config"

Change to :

if "%ACTIVEMQ_OPTS%" == "" set ACTIVEMQ_OPTS=-Xms1G -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config="%ACTIVEMQ_CONF%\login.config" -Dhawtio.realm=activemq -Dhawtio.role=admins -Dhawtio.rolePrincipalClasses=org.apache.activemq.jaas.GroupPrincipal

There is an "activemq" file in the bin folder (as a reference for env file in linux) Do not edit any of its contents , everything is managed by the batch file.

EDIT

The above solution is for manually debugging with activemq.bat

To apply hawtio at activemq service level , add the following lines to the wrapper.conf following your os type (win32 or win64)

Lines:

wrapper.java.additional.13=-Dhawtio.realm=activemq
wrapper.java.additional.14=-Dhawtio.role=admins
wrapper.java.additional.15=-Dhawtio.rolePrincipalClasses=org.apache.activemq.jaas.GroupPrincipal

Add additional accordingly (if you have more than 13 lines change the additional to 14 etc..)

# Java Additional Parameters
# note that n is the parameter number starting from 1.
wrapper.java.additional.1=-Dactivemq.home="%ACTIVEMQ_HOME%"
wrapper.java.additional.2=-Dactivemq.base="%ACTIVEMQ_BASE%"
wrapper.java.additional.3=-Djavax.net.ssl.keyStorePassword=password
wrapper.java.additional.4=-Djavax.net.ssl.trustStorePassword=password
wrapper.java.additional.5=-Djavax.net.ssl.keyStore="%ACTIVEMQ_CONF%/broker.ks"
wrapper.java.additional.6=-Djavax.net.ssl.trustStore="%ACTIVEMQ_CONF%/broker.ts"
wrapper.java.additional.7=-Dcom.sun.management.jmxremote
wrapper.java.additional.8=-Dorg.apache.activemq.UseDedicatedTaskRunner=true
wrapper.java.additional.9=-Djava.util.logging.config.file=logging.properties
wrapper.java.additional.10=-Dactivemq.conf="%ACTIVEMQ_CONF%"
wrapper.java.additional.11=-Dactivemq.data="%ACTIVEMQ_DATA%"
wrapper.java.additional.12=-Djava.security.auth.login.config="%ACTIVEMQ_CONF%/login.config"
wrapper.java.additional.13=-Dhawtio.realm=activemq
wrapper.java.additional.14=-Dhawtio.role=admins
wrapper.java.additional.15=-Dhawtio.rolePrincipalClasses=org.apache.activemq.jaas.GroupPrincipal

Since this isn't documented ANYWHERE (Amq Website or Hawtio Website) I hope this answer will help with future issues.