Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6548639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:59:40+00:00 2026-05-25T11:59:40+00:00

An application is using JBoss 4.2.2, and I have found it necessary to call

  • 0

An application is using JBoss 4.2.2, and I have found it necessary to call listThreadDump(), and I expect it is in ServerInfo.

I am thinking the jar I need to find this information is jboss-jmx.jar.

So, how do I programmatically duplicate what is done by calling something similar to http://localhost:8080/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:type=ServerInfo&methodName=listThreadDump?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:59:41+00:00Added an answer on May 25, 2026 at 11:59 am

    This is how I have accessed the ServerInfo MBean. I’m using JBoss AS 5.1, but this method should be the same.

    To call listThreadDump(), you can invoke() the method on the ServerInfo MBean using an MBeanServer instance.

    Additionally, you can access attributes of MBeans using the same MBeanServer.

    Sample code:

    // imports
    import javax.management.MBeanServer;
    import javax.management.ObjectName;
    import org.jboss.mx.util.MBeanServerLocator;
    
    try {
        MBeanServer server = MBeanServerLocator.locate();
        ObjectName name = new ObjectName("jboss.system:type=ServerInfo");
        // invoke the listThreadDump method and capture its output
        String threadDumpHtml = (String) server.invoke(name, "listThreadDump", null, null);
    
        // access a simple attribute of the ServerInfo object
        String jvmName = (String) server.getAttribute(name, "JavaVMName");
    } catch (Exception e) {
        // Ideally catch the 3 exact exceptions
    }
    

    Finally, I find it handy when MBeans expose an ‘instance’ attribute, so you can then access the object directly (CastToType) server.getAttribute(name, "instance") instead of always going through the MBeanServer. For example, when using JMS, the ServerPeer instance is nice to have as you can get message counters on your queues and topic subscribers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using: Hibernate MySQL jBoss I have to create an application that allows user
I have a Spring application deployed in JBoss EAP server, using the following settings:
I wrote an application using ASP.NET MVC, in this application I have an Index
We have a standard j2ee application written using jboss richfaces 3.3.x. we have several
I have legacy application using struts & ejb2.0 , hibernate v3.0 running on JBoss
I'm writing a Java EE application using JBoss AS 6 and I have a
I have an application server (JBoss, but this also happens in Tomcat) running as
I have a problem deploying an Axis 2 web application. I'm using Jboss 4.2.0,
I try to run jsf application in myeclipse using jboss web server and following
Currently developing an application using the newest version of symfony, obtained through PEAR. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.