Wednesday, October 23, 2013

JMXConsole

JMX Console


After JBoss has succesfully started you can locate the JMX console at http://localhost:8080/jmx-console in the default distribution. Notice that if you have configured the servlet container (Tomcat) to service a different port then you need to supply another port number in the URL.

The JMX console provides a raw view into the microkernel of the JBoss application server. It lists all registered services (MBeans) that are active in the application server and that can be accessed either through the JMX console itself or programmatically from Java code.

Things to do with the JMX Console:



Topics:



The JMX Console looks like this:


  

Generate a Thread Dump using JMX Console (JBoss AS 3,4,5,6)

This page may be obsolete.

Generate a thread dump using JMX Console


In order to generate a thread dump:

1. Open the JMXConsole (for example: http://localhost:8080 )
2. Navigate to jboss.system:type=ServerInfo mbean (hint: you can probably just CTRL-F and enter type=ServerInfo in the dialog box)
3. Click on the link for the Server Info mbean.
4. Navigate to the bottom where it says "listThreadDump"
5. Click it and get your thread dump
6. Enjoy your thread dump (and/or debug your problem, send it up to JBoss support or attach it to your bug report)

Notes:

If you are using Internet Explorer you should use File -> Save As to save the output instead of copying the data to a text editor.  For some reason when you copy the text from Internet Explorer the line breaks are not copied and all of the output ends up on a single line.

Generate a Thread Dump using Twiddle

Alternatively you can use twiddle to execute the listThreadDump method and pipe the returned HTML directly to file i.e.

/bin/twiddle invoke "jboss.system:type=ServerInfo" listThreadDump > threads.html

-

Update for JBoss v3.2.8/4.0.2 - when running under JDK5 additional information is printed for each thread (id, state, lockName, and a full StackTrace)

-

-

No comments: