Home > My Work > How to connect jconsole to a remote tomcat on a linux machine resolving connection refused issue

How to connect jconsole to a remote tomcat on a linux machine resolving connection refused issue

Follow these steps:

open the jmx port on the tomcat jvm

fill the setEnv.sh (under TOMCAT-HOME/bin) with the following parameters


CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=9011 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false"

It’s important to use CATALINA_OPTS and not JAVA_OPTS to resolve tomcat shutdown issue

On linux it’s likely to have a connection refused issue.

So start jconsole in debugging mode (jconsole -debug from a terminal). If you see a local (from server point of view) ip (e.g. 127.0.1.1) you must go on server, type hostname -i and see how the hostname it’s resolved by the server (e.g. 127.0.1.1). Then you must change the row of etc/hosts file where the server hostname is translated into the local ip (127.0.1.1). You can delete the row and use the DNS or insert the server ip.

References

http://muzso.hu/2008/11/28/connecting-to-a-tomcat-instance-with-jconsole

http://docs.oracle.com/javase/6/docs/technotes/guides/management/faq.html

Advertisements
Categories: My Work Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: