How to Access MBeanServerConnection from remote JMX Client in JBoss EAP 6.x
Issue
- The JMX access seems to have changed in JBoss EAP 6, So how can we access the
javax.management.MBeanServerConnection
in order to query JBoss EAP6. - Is there some function that can be called while JBoss EAP shutdown?
- How is
JMX-remoting
configured in JBoss EAP 6.1? - How can we make visible any MBean registered at the JBoss EAP 6.2 and how to setup JBoss for accessing the JBoss MBeans remotely?
- We have several custom mbeans that we are registering at JVM startup using basic JMX APIs. Here is sample code on how we registered:
MBeanServer server = ManagementFactory.getPlatformMBeanServer();
String objectName = packageName + ":type=" + className;
ObjectName mbeanName = new ObjectName(objectName);
server.registerMBean(mbean, mbeanName);
- From within the JVM, I can connect to the Platform MBean Server and get information about my custom MBeans but if I try to use the remoting API from a different server I can only see the JBoss MBeans. Remoting code example:
Map feature=new HashMap();
String[] data=new String[]{"id","pwd"};
feature.put(JMXConnector.CREDENTIALS, data);
String url = "service:jmx:remoting-jmx://{host}:{port}";
JMXServiceURL jurl = new JMXServiceURL(url);
JMXConnector connector = JMXConnectorFactory.connect(jurl, feature);
- I am assuming that I am connecting to the domain controller MBean Server and my custom MBeans are registered in the JVM MBean Server. So Is it even possible to connect to custom standard mbeans in domain mode?
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.