This content has been marked as final. Show 2 replies
I have written a code like this......but iam unable to get the MBean names.......
ObjectName name = new ObjectName("*:*");
ObjectName filter = new ObjectName("*:*");
Set names = server.queryNames(name,filter);
String array = (String)set.toArray(new String[set.size()]);
If that is really the code you are using then the problem is that your Set is sometimes called "names" and sometimes "set". Other than that the code seems correct, although server.queryNames(null, null) would work just as well as the explicit values you have provided.
Éamonn McManus -- JMX Spec Lead -- [http://weblogs.java.net/blog/emcmanus]