DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Deploy a Java application using Helm, Part 2
  • Deploy a Java application using Helm, Part 1
  • Okta + SAML + JBoss EAP 6.4.x + Picketlink
  • Migration of Java-Based Web Applications From Commercial to Open Source Software

Trending

  • Using Open Source for Data Integration and Automated Synchronizations
  • Application Integration for IoT Devices: A Detailed Guide To Unifying Your Ecosystem
  • Supercharge Your Software Development Journey With DevOps, CI/CD, and Containers
  • Understanding Europe's Cyber Resilience Act and What It Means for You
  1. DZone
  2. Coding
  3. Java
  4. HawtIO on JBoss EAP (Part II)

HawtIO on JBoss EAP (Part II)

Christian Posta user avatar by
Christian Posta
·
Jul. 31, 14 · Interview
Like (0)
Save
Tweet
Share
6.70K Views

Join the DZone community and get the full member experience.

Join For Free


i just posted an entry on running hawtio on jboss wildfly 8.1 recently. from that post you know how awesome hawtio is , and all of the cool plugins it has to make managing your jvm based technologies from a single dashboard… well… hawt ….

hawtio

however, i wanted to dedicate a post to running hawtio on jboss eap for the same reasons outlined in the previous post:

as we at red hat roll out jboss fuse and jboss fuse serviceworks , we’re getting better at integrating the individual components. for example, a fuse service works subscription gives you full access to a-mq, fuse, and all of its components, including hawtio. unfortunately, hawtio isn’t “officially” supported in eap as of today, but that will be fixed in next releases. it’s not a limitation of the technology, it’s just there’s so much there and red hat has stringent testing/compatibility requirements so we need to have all of the testing/certification done before we “support it” fully.

but… there’s really no reason to not use it anyway (at least development and qa), while we wait for support. and there are lots of people already doing that. just remember, it’s not officially supported yet!

so the rest of this blog is a step-by-step guide with best practices for getting hawtio deployed and secured on your jboss eap 6.x application server. i will use hawtio 1.4.11 (latest release from the community) for this guide.

eap

hawtio on jboss eap 6.1

this first section will discuss eap 6.1 because it seems to work great following the similar directions as those for deploying hawtio on wildfly 8.1 . basically, if you follow the instructions from the blog post on running on wildfly, you’ll get it working just fine . to be very specific do these pieces:

  • remove the log4j.properties file to use eap logging subsystem
  • rename distro to hawtio.war
  • create users in applicationrealm with roles including “admin”
  • edit the standalone.xml file to account for the following settings:

i’ve also added [these instructions to the hawtio documentation][http://hawt.io/getstarted/index.html] (the website should update with those changes soon).

after successfully deploying hawtio to jboss eap 6.1 , you should be greeted with a login page at this url:

http://localhost:8080/hawtio

login-page

hawtio on jboss eap 6.2

so unfortunately, getting hawtio to run on jboss eap 6.2 has some issues with jaas that i haven’t been able to figure out. if you’re a wildfly 7/eap 6.x wizard and wish to take a look have a peek at the github issue i have open .

thankfully, however, hawtio is quite versatile and doesn’t have to be run as a web-app collocated on the container you want to manage. you can run it standalone as a chrome extension or in a separate container that’s not jboss eap. effectively, you can use hawtio’s connect page to remotely connect to the container you wish to manage.

for example, download the standalone distribution of hawtio which ends up just being an executable jar. run it like this (make sure to add the params for the port change, because we don’t want to conflict with the eap ports if running on the same machine):

ceposta@postamachat(standalone) $ java -jar hawtio-app-1.4.11.jar --port 9091

this will bring up hawtio running standalone (with an internal jetty server! woohoo!).

then click the “connect” tab and you should see a page like this:

connect tab

wait, what? just connect?

“how would this even work”" you ask? “how can we connect to eap and have hawtio just manage it?”

well, the magic is this totally awesome little library named jolokia .

jolokia

jolokia provides rest access to your jmx tree. so the way to get hawtio to manage your jboss eap 6.2 container is to enable jolokia on it and then use hawtio’s connect tab to log in. if you haven’t taken a look at jolokia, you’re missing out!! no more complicated jmx api/clients and query/filter api. just use rest endpoints and curl. simple.

jolokia has a few options for deploying/enabling . the most straight forward is a web app, but you could also attach as a jvm agent at startup time. we’ll take the easy approach and deploy jolokia as a webapp:

rename distro

for this blog post, i’m using jolokia 1.2.2. so when you download it, it has a name like this jolokia-1.2.2.war . let’s rename the distro so we don’t take into account the version numbers to make it easier to get to the url:

ceposta@postamachat(rename) $ mv jolokia-war-1.2.2.war jolokia.war

enable security for jolokia

next, we want to enable security for the jolokia web app. we’ll do that as described in the jolokia documentation . we’ll need to edit the web.xml file that comes in the jolokia jar and uncomment the section that’s blocked out for security:

ceposta@postamachat(rename) $ vi jolokia.war

your config in web-inf/web.xml should have a security section like this:

163   <!--
164   example configuration for switching on basic security. the role 'jolokia'
165   must be mapped to real users with passwords on the appserver side:
166   -->
167   <login-config>
168     <auth-method>basic</auth-method>
169     <realm-name>jolokia</realm-name>
170   </login-config>
171
172   <security-constraint>
173     <web-resource-collection>
174       <web-resource-name>jolokia-agent access</web-resource-name>
175       <url-pattern>/*</url-pattern>
176     </web-resource-collection>
177     <auth-constraint>
178       <role-name>jolokia</role-name>
179     </auth-constraint>
180   </security-constraint>
181
182   <security-role>
183     <role-name>jolokia</role-name>
184   </security-role>
185
186 </web-app>

now add a user like we did in the previous blog that has a role of “jolokia”. note, make sure this user is added to the applicationrealm.

connect to eap 6.2

now go back to your standalone hawtio (we deployed it in the previous step at http://localhost:9091/hawtio ) and enter the connect params (path as follows):

click “connect to remote server” and viola! you’re conencted.

where to go from here

you can also try to enable ssl over the http connection as well as maybe use digest auth instead of the default basic auth. i’ll leave that as an exercise for the reader :)

if you have any questions about hawtio , please

JBoss Enterprise architecture planning

Published at DZone with permission of Christian Posta, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Deploy a Java application using Helm, Part 2
  • Deploy a Java application using Helm, Part 1
  • Okta + SAML + JBoss EAP 6.4.x + Picketlink
  • Migration of Java-Based Web Applications From Commercial to Open Source Software

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: