Very stange Behavior with JMX remote
Hi
I've an application written with Spring. JMX support works good locally bu I'm unable to connect from remote computer.
I'm starting with :
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=4099 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
When I launch jconsole on the same computer I connect and I see all my Mbean working perfectly
If I try to connect from other computer with Jconsole I get "connection failed"
There is no firewall issue I'm on the same vlan, and on dev machine without any firewall installed.
Thanks for any help
Hi,
When you connect from the same computer, do you connect
'localy' (using the process PID) or 'remotely' (using host and port 4099)?
You may also want to switch on the JMX traces, see
http://blogs.sun.com/jmxetc/entry/troubleshooting_connection_problems_in_jconsole
Hope this helps,
-- daniel
JMX, SNMP, Java, etc...
http://blogs.sun.com/jmxetc
Hi,
If I connect from the same machine even by using ip:port it's working. It's only not working from other physical computer
I've run the jconsole with trace I get this:
FINER: [javax.management.remote.rmi.RMIConnector: jmxServiceURL=service:jmx:rmi:
///jndi/rmi://xxx.xxx.xxx.xxx:4099/jmxrmi] failed to connect: java.rmi.ConnectExcep
tion: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused: connect
Now I'm very confused because why it use 127.0.0.1 instead of using the real ip
Hi,I'm afraid the server JVM must set -Djava.rmi.server.hostname=127.0.0, or an RMI server socket factory that binds the sockets to 127.0.0.1 or maybe the configuration of your /etc/hosts file.Regards,Luis
Check your hosts file and ensure you don't have an entry like this
172.0.0.2 <machine hostname> where "machine hostname" is also the name of your machine in DNS.
What seems to happen is the client connects and then re-resolves the machine name locally which will result in /etc/hosts being read and then it thinks your ip is 172.0.0.2, (or 172.0.0.1 depending on your set up).
Remove the entry from /etc/hosts and you should be good to go. Took me 4hrs but I got there!