I enable JMX server and JMX Registry in Tomcat using
<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
rmiRegistryPortPlatform="10001" rmiServerPortPlatform="10002" />
Client connects to 10001 and Tomcat returns its address and port 10002, right? But if I have several addresses on the interface Tomcat returns the first one.
For you question: you should specify -Djava.rmi.server.hostname=xxx.xxx.xxx.xxx
as outlined in the answer Tomcat 6, JMX and the dynamic port problem
As an answer how to configure direct access: specify the JMX remote port as outlined in Monitoring and Managing Tomcat:
set CATALINA_OPTS=-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=%my.jmx.port%
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
As far as understand, the calls are still done as RMI calls.