This content has been marked as final.
Show 2 replies
-
1. Re: Is it feasible to connect tojmx rmi service using old method ?
shyam9433 Aug 31, 2015 9:35 AM (in response to shyam9433)And is this change generic, say for tomcat also..or only wildfly.
-
2. Re: Is it feasible to connect tojmx rmi service using old method ?
mayerw01 Aug 31, 2015 11:08 AM (in response to shyam9433)The exact format of the service:jmx depends on the server version.
But you may use a structure like this:
public class JMXExample {
public static void main(String[] args) throws Exception {
String urlString ="service:jmx:remoting-jmx://" + host + ":" + port;
JMXServiceURL serviceURL = new JMXServiceURL(urlString);
JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceURL, null);
System.out.println("Connected to: "+ jmxConnector);
System.out.println(jmxConnector.getMBeanServerConnection().getMBeanCount() + " MBeans");
jmxConnector.close();
}
}