JDK-7133494 : [macosx] JMX: java.rmi.ConnectIOException: non-JRMP server at remote endpoint
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 7u4
  • Priority: P4
  • Status: Resolved
  • Resolution: Won't Fix
  • OS: os_x
  • CPU: x86
  • Submitted: 2012-01-26
  • Updated: 2018-10-02
  • Resolved: 2018-10-02
Description
From http://java.net/jira/browse/MACOSX_PORT-393 --

Server.java: 
import javax.management.*;
import javax.management.remote.*;
import java.rmi.registry.LocateRegistry;
import java.util.Collections;

public class Server {
public static void main(String[] args) throws Exception { LocateRegistry.createRegistry(7000); JMXServiceURL jmxSrvUrl = new JMXServiceURL("service:jmx:rmi://localhost/jndi/rmi://localhost:7000/jmxrmi"); MBeanServer mbServer = MBeanServerFactory.newMBeanServer(); JMXConnectorServerMBean jmxServer = JMXConnectorServerFactory.newJMXConnectorServer(jmxSrvUrl, Collections.EMPTY_MAP, mbServer); jmxServer.start(); }
}

Client.java:
import javax.management.remote.*;
import java.util.Collections;

public class Client {
public static void main(String[] args) throws Exception { JMXServiceURL jmxSrvUrl = new JMXServiceURL("service:jmx:rmi://localhost/jndi/rmi://localhost:2000/jmxrmi"); JMXConnector jmxConnector = JMXConnectorFactory.newJMXConnector(jmxSrvUrl, Collections.EMPTY_MAP); jmxConnector.connect(); jmxConnector.close(); }
}

How to reproduce:
$ .../bin/java -Drmiregistry.port=7000 -Dcom.sun.management.jmxremote.port=2000 -Dcom.sun.managemenemote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false Server &
$ .../bin/java Client