I have a tomcat application on the remote host and need to connect it by JConsole. Application starts with params:
IP=`ifconfig eth0 | grep 'inet addr:' | cut -d ':' -f2 | cut -d ' ' -f1`
-Dcom.sun.management.jmxremote
-Djava.rmi.server.hostname=$IP
-Dcom.sun.management.jmxremote.port=9999
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
Port 9999 is open, IP
value is valid, I checked it. I can access it by telnet (telnet <my_host> <my_port>
). Netstat:
netstat -a | grep LISTEN
tcp 0 0 *:9999 *:* LISTEN
But I can't connect it via jconsole, I allways get same error:
Connection Failed: Retry?
But netstat -a
shows that the connection is ESTABLISHED
I tried different addresses:
<my_host>:<my_port>
service:jmx:rmi://<my_host>:<my_port>/jndi/rmi://<my_host>:<my_port>/jmxrmi
service:jmx:rmi:///jndi/rmi://<my_host>:<my_port>/jmxrmi
I also tried to add files .../conf/remote.users
and .../remote.acl
and write pathes to that files in prorerties -Dcom.sun.management.jmxremote.password.file
and -Dcom.sun.management.jmxremote.access.file
but it had no effect.
When I deploy this app on my local machine, i can connect to it at "localhost:9999"
Help somebody, what could be the problem?
telnet <my_host> <my_port>
, if you not able to connect then check firewall setting between these two machines. – Mahendraecho $IP
after IP=ifconfig eth0 | grep 'inet addr:' | cut -d ':' -f2 | cut -d ' ' -f1
to verify valid IP value. – MahendraIP
value is valid, I checked it andtelnet <my_host> <my_port>
works fine – Kirill$IP
you're using is not somehow translated in the machine's/etc/hosts
to internal loopback address? – Avihoo Mamka/etc/hosts
doesn't contains<my_host>
– Kirill