This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JMX: How to list all the application servers on the node regardless of their statuses

Eric Liao
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I need to write a tool that can manage all the application servers using JMX only.

But I have problem in getting all the existing Application Server names.
I don't know why but it seems like only when one Application Server is started, I can get its name by getting the MBean registered for it.

So my question is:

Is their anyway to get a list of ALL the Application Server names even if it is stopped??

//The following is how I get all the running servers.

String query = "Websphere:*";
ObjectName queryName = new bjectName(query);
Set<ObjectName> set = adminClient.queryNames(queryName, null);
for(Iterator<ObjectName> i = set.iterator(); i.hasNext(); queryName = (ObjectName)
String type = queryName.getKeyProperty("type")

if (type!=null&&type.equals("Server"))
System.out.println(queryName.getKeyPropertyListString()); //print all the mbeans of type "Server"

// Through this, I can only list the ones that are started, how am I supposed to list the application servers that are not running??

Thanks in advance,

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic