views:

1052

answers:

3

Hi,

If checked the other questions regarding this issue but so far no soultion. Here is my setup: TC6 runs on a debian vm on my macbook. in /etc/default/tomcat6.0 I have following options set:

CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8086 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"

netstat -ntlp gives me:

tcp6       0      0 :::8080                 :::*                    LISTEN      6550/java
tcp6       0      0 :::8086                 :::*                    LISTEN      6550/java

Where 6550:

root      6550  3.3  6.8 224888 52984 pts/0    Sl   10:31   0:43 /usr/lib/jvm/java-6-sun/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/var/lib/tomcat6.0/conf/logging.properties -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8086 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.endorsed.dirs=/usr/share/tomcat6.0/common/endorsed -classpath :/usr/lib/jvm/java-6-sun/jre//lib/jcert.jar:/usr/lib/jvm/java-6-sun/jre//lib/jnet.jar:/usr/lib/jvm/java-6-sun/jre//lib/jsse.jar:/usr/share/tomcat6.0/bin/bootstrap.jar:/usr/share/tomcat6.0/bin/commons-logging-api.jar -Dcatalina.base=/var/lib/tomcat6.0 -Dcatalina.home=/usr/share/tomcat6.0 -Djava.io.tmpdir=/var/lib/tomcat6.0/temp org.apache.catalina.startup.Bootstrap start

Firewall:

Chain INPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     all      anywhere             anywhere            

Chain FORWARD (policy DROP)
target     prot opt source               destination         

Chain OUTPUT (policy DROP)
target     prot opt source               destination         
ACCEPT     all      anywhere             anywhere 

When I try to connect from OSX using jvisualm: - adding a new host with the hostname of my vm (added it to /etc/hosts) - adding a new JMX-Connection

VisualVM fails with:

Cannot connect using service:jmx:rmi///jndi/rmi://<vmhostname>:8086/jmxrmi

When I connect to my VM using ssh -X and start jvisualvm on the same machine that tomcat is running on, I do not initially see TC, but I can add the jmx connection as above.

Could this be an issue with foreign hosts being misteriously prevented to access the rmiregistry? Why would anyone do such a dumb thing?

What am I doing wrong?

(sorry 4 the lengthy post)

A: 

Make sure that you can

a) ping <vmhostname>
b) telnet <vmhostname> 8086

Note also that you can use IP address instead of <vmhostname>

Tomas Hurka
The VM is up and I can connect. No clue :(Just tried jconsole, which fails as well.
er4z0r
Does it mean that you can connect to port 8086 from Mac OS X to your VM?I am not surprised that jconsole does not work. Both VisualVM and jconsole uses the same code to do JMX connection.You can try to run tcpdump on your VM and see if there is any communication on port 8086.Oh and I just noticed tcp6 - does it mean you are using IPv6? If so, this could be a reason, why you cannot connect to Tomcat.
Tomas Hurka
Thanks. I'll see if I can wrap it in ipv4 somehow.
er4z0r
A: 

HI,

make sure the jstatd proces is running on the remote machine which u want to monitor with required permission.

vishwanath
A: 

Check out the jmx listener on this page. http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html

It lets you set both the JMX port and the RMI registry port, both of which have to open on your firewall.

John Russell