= Meecrowave Jolokia :jbake-date: 2016-12-04 :jbake-type: page :jbake-status: published :jbake-meecrowavepdf: :jbake-meecrowavetitleicon: icon icon_puzzle_alt :jbake-meecrowavecolor: body-red :icons: font Coordinates: [source,xml] ---- org.apache.meecrowave meecrowave-jolokia ${meecrowave.version} ---- == Jolokia only If Hawt.io is not setup (not there or inactive) the module will set up jolokia alone. It will deploy the jolokia servlet on `/jolokia/*` or the property `jolokia.web.mapping` set on the `Meecrowave.Builder`. IMPORTANT: don't forget to secure this endpoint cause it let you access all the JMX MBeans. See Meecrowave core configuration for more details. More on https://jolokia.org/reference/html/ == Hawt.io By default hawt.io will be deployed and activated on `/hawtio/` endpoint. To activate it you need to add these dependencies: [source,xml] ---- io.hawt hawtio-springboot 1.4.67 true org.springframework.boot spring-boot-starter-web org.apache.logging.log4j log4j-slf4j-impl ${log4j2.version} true ---- NOTE: we don't need spring boot but we reuse hawt.io spring boot module which packages web resources in a jar. By default it will setup the security to use the Servlet security which means you can use meecrowave options: [source] ---- ./meecrowave-runner --users=admin=admin --roles=admin=admin ---- And log with admin/admin user. == Running HawtIO war To run http://hawt.io, the easiest is to setup jaas and run the hawt.io war: [source] ---- java -Djava.security.auth.login.config=login.config \ -jar meecrowave-runner.jar \ -webapp hawtio-default-offline-1.4.67.war ---- This assumes you created a `login.config`: [source] ---- karaf { org.apache.catalina.realm.JAASMemoryLoginModule required pathname="/path/to/tomcat-users.xml"; }; ---- NOTE: the JAAS login module is named `karaf` because it is the default of hawt.io (check `io.hawt.web.AuthenticationFilter.init()`). And if you use - as in previous snippet - tomcat-users.xml you need to create an admin (role) user: [source,xml] ---- ---- NOTE: don't try to use `io.hawt.web.tomcat.TomcatUserDatabaseLoginContext` of hawt.io which does the same as `JAASMemoryLoginModule` excepted it doesn't handle absolute paths which enforce you to use a `catalina.base`. Using hawt.io war you don't need to run jolokia servlet by yourself, it is already done.