Making a JMX connection from a client deployed in EAP 6 to an EAP 5 server

Solution Verified - Updated -

Issue

We need to connect from a servlet deployed in JBoss EAP 6.0.1 via JMX to a JBoss EAP 5 server.
This fails with:

Caused by: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NameNotFoundException: rmi://127.0.0.1:9999/jmxrmi -- service jboss.naming.context.java.rmi:."127.0.0.1:9999".jmxrmi
    at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:340) [:1.6.0_26]
    at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248) [:1.6.0_26]
    at com.example.JMXConnectionBean.init(JMXConnectionBean.java:28)
[snip]
Caused by: javax.naming.NameNotFoundException: rmi://127.0.0.1:9999/jmxrmi -- service jboss.naming.context.java.rmi:."127.0.0.1:9999".jmxrmi
    at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:87)
    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:173)
    at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:47)
    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:209)
    at javax.naming.InitialContext.lookup(InitialContext.java:392) [:1.6.0_26]
    at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1888) [:1.6.0_26]
    at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1858) [:1.6.0_26]
    at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:257) [:1.6.0_26]
    ... 37 more

Environment

JBoss Enterprise Application Platform (EAP) 5.x, 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.