This discussion is archived
0 Replies Latest reply: Nov 23, 2009 1:42 AM by 843798 RSS

jconsole connection did not succeed with tomcat on different machine

843798 Newbie
Currently Being Moderated
Hi,

I want to monitor tomcat's jvm through jconsole .I am trying to connect
jconsole to tomcat's jvm through jmx(on different machines) I get*connection did not succeed* message:

jconsole is running on ubuntu linux and tomcat jvm is running on red hat linux

when jconsole was started with debug msg enabled I get the below error message:

+$ jconsole -J-Djava.util.logging.config.file=logging.properties+
+23 Nov, 2009 1:22:20 PM RMIConnector connect+
+FINER: [javax.management.remote.rmi.RMIConnector:
jmxServiceURL=service:jmx:rmi:///jndi/rmi://test.mgrsearch.com:9004/jmxrmi]
connecting...+
+23 Nov, 2009 1:22:20 PM RMIConnector connect+
+FINER: [javax.management.remote.rmi.RMIConnector:
jmxServiceURL=service:jmx:rmi:///jndi/rmi://test.mgrsearch.com:9004/jmxrmi]
finding stub...+
+23 Nov, 2009 1:22:20 PM RMIConnector connect+
+FINER: [javax.management.remote.rmi.RMIConnector:
jmxServiceURL=service:jmx:rmi:///jndi/rmi://test.mgrsearch.com:9004/jmxrmi]
connecting stub...+
+23 Nov, 2009 1:22:20 PM RMIConnector connect+
+FINER: [javax.management.remote.rmi.RMIConnector:
jmxServiceURL=service:jmx:rmi:///jndi/rmi://test.mgrsearch.com:9004/jmxrmi]
getting connection...+
+23 Nov, 2009 1:22:20 PM RMIConnector connect+
+FINER: [javax.management.remote.rmi.RMIConnector:
jmxServiceURL=service:jmx:rmi:///jndi/rmi://test.mgrsearch.com:9004/jmxrmi]
failed to connect: *java.rmi.UnknownHostException: Unknown host:
'test.mgrsearch.com'; nested exception is:* +
java.net.UnknownHostException: 'test.mgrsearch.com'+


while trying telnet .. it is accessble

+$ telnet test.mgrsearch.com 9004+
Trying 10.80.3.130...
Connected to blrldev30.mihblr.om.
Escape character is '^]'.


and have started tomcat in following manner:

+$ export JAVA_HOME="/usr/java/jdk1.6.0_17/"+
+$ export CATALINA_OPTS="-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9004
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname='test.mgrsearch.com'"+
+$ /apache-tomcat-5.5.27/bin/startup.sh+


when I do catalina opts has been correctly used for starting tomcat
$ ps -ef |grep "java"
adxuser 12040 1 0 12:46 pts/0 00:00:08 /usr/java/jdk1.6.0_17//bin/java
-Djava.util.logging.config.file=/home/adxuser/solr-tomcat/apache-tomcat-5.5.27/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9004
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname='test.mgrsearch.com'
-Djava.endorsed.dirs=/home/adxuser/solr-tomcat/apache-tomcat-5.5.27/common/endorsed
-classpath
:/home/adxuser/solr-tomcat/apache-tomcat-5.5.27/bin/bootstrap.jar:/home/adxuser/solr-tomcat/apache-tomcat-5.5.27/bin/commons-logging-api.jar
-Dcatalina.base=/home/adxuser/solr-tomcat/apache-tomcat-5.5.27
-Dcatalina.home=/home/adxuser/solr-tomcat/apache-tomcat-5.5.27
-Djava.io.tmpdir=/home/adxuser/solr-tomcat/apache-tomcat-5.5.27/temp
org.apache.catalina.startup.Bootstrap start
adxuser 12393 11903 0 14:46 pts/0 00:00:00 grep java


but when I took the above command ( output from ps -ef |grep "java" ) and ran the command directly from the terminal (below):

+$ /usr/java/jdk1.6.0_17//bin/java
-Djava.util.logging.config.file=/home/adxuser/solr-tomcat/apache-tomcat-5.5.27/conf/logging.properties
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9004
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname='test.mgrsearch.com'
-Djava.endorsed.dirs=/home/adxuser/solr-tomcat/apache-tomcat-5.5.27/common/endorsed
-classpath
:/home/adxuser/solr-tomcat/apache-tomcat-5.5.27/bin/bootstrap.jar:/home/adxuser/solr-tomcat/apache-tomcat-5.5.27/bin/commons-logging-api.jar
-Dcatalina.base=/home/adxuser/solr-tomcat/apache-tomcat-5.5.27
-Dcatalina.home=/home/adxuser/solr-tomcat/apache-tomcat-5.5.27
-Djava.io.tmpdir=/home/adxuser/solr-tomcat/apache-tomcat-5.5.27/temp
org.apache.catalina.startup.Bootstrap start+
+.+
+.+
+.+
+.+
+.+
Nov 23, 2009 2:56:37 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Nov 23, 2009 2:56:38 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6196 ms

I am able to connect jconsole with tomcat (in different machine) and monitor it without any problem .
I spent one whole day to try figure out problem (searching in google and by trying out different things) but other worked out.
any help would be appreciated

Thanks in advance.
Bharath