Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

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,

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!