• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Tomcat and VisualVM

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the info on tomcat, java, and my OS from tomcat/bin/version.sh:

JAVA_OPTS = -Xms2048m -Xmx2048m -XX:PermSize=192m -XX:MaxPermSize=192m -XX:+CMSClassUnloadingEnabled -Djava.awt.headless=true -Djava.library.path=/swadm/usr/local/lib -Dfile.encoding=UTF-8
CATALINA_OPTS = -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Djava.rmi.server.hostname=xxx.xxx.xxx.119 -Dcom.sun.management.jmxremote.password.file=/swadm/usr/local/tomcat/conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/swadm/usr/local/tomcat/conf/jmxremote.access -verbose:gc
Using CATALINA_BASE: /swadm/usr/local/tomcat
Using CATALINA_HOME: /swadm/usr/local/tomcat
Using CATALINA_TMPDIR: /swadm/usr/local/tomcat/temp
Using JRE_HOME: /swadm/usr/java
Using CLASSPATH: /swadm/usr/local/tomcat/bin/bootstrap.jar:/swadm/usr/local/tomcat/bin/tomcat-juli.jar
Server version: Apache Tomcat/7.0.42
Server built: Jul 2 2013 08:57:41
Server number: 7.0.42.0
OS Name: Linux
OS Version: 2.6.32-431.el6.x86_64
Architecture: amd64
JVM Version: 1.7.0_45-b18
JVM Vendor: Oracle Corporation

I have verified that my jmxremote.password/access files are where they are supposed to be and readable...

Here is the listener I have configured from server.xml:

<Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
rmiRegistryPortPlatform="9098" rmiServerPortPlatform="9099" />

both 9098 and 9099 are open on the firewall (verified using nc on the same host as VisualVM)

Of course, I wouldn't be here if there was not a problem! This setup does not work... When creating a JMX connection, it fails with:

Cannot connect to xxx.xxx.xxx.xxx:9098 using service:jmx:rmi://xxx.xxx.xxx.xxx:9098/jmxrmi

I have tried with authenticate=true, authenticate=false (that's the above example) and a whole slew of other failed attempts.

Can anybody point out the error in my ways? I have spent an entire day on this -- one that I'll never get back!! Help!

Thanks in advance for looking this over...
Bill
 
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have never set up the Listener element, just the properties in catalina.sh. Here's what I use on one server:

-Djava.rmi.server.hostname=w.x.y.z
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=10048
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=true
-Dcom.sun.management.jmxremote.password.file=...
-Dcom.sun.management.jmxremote.access.file=...

And it only needs that one port, not two.
 
William Alfred
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf,
Thanks, you are correct, you can do it this way. However, rmi opens another random port. No problem, unless your server is behind a firewall. The Listener should allow you to specify both ports...
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!