I have a CentOS+CPanel+Tomcat+Spring+MySQL+Flex architecture.

I need to monitor my application's memory because Tomcat is crashing from time to time. I read that JMX + Jconsole its a great choice. So i'm setting those variables in CATALINA_OPTS (in CPanel, you add the options in a file called tomcat.options). But I get an invalid port error. I tried with several port numbers: 8181, 8999, 3000. This is a tomcat.options file that doesn't work:

-Dcom.sun.management.jmxremote  
-Dcom.sun.management.jmxremote.port=8999  
-Dcom.sun.management.jmxremote.ssl=false  
-Dcom.sun.management.jmxremote.authenticate=false  
-Djava.rmi.server.hostname=li170-64

I googled the error and could not find anyone else with the same error. What's wrong?

link|improve this question

59% accept rate
feedback

migrated from stackoverflow.com Aug 3 '11 at 12:59

This question came from our site for professional and enthusiast programmers.

1 Answer

There were spaces after the port number line:

-Dcom.sun.management.jmxremote.port=8999(space)(space)

I removed it and it worked!

link|improve this answer
Thank you so very much for posting this finding. I cant tell you how handy this post came in. I knew i was doing everything right but still couldnt get this configuration to work. My attempt was in a WebSphere environment - but it still helped. space - so trivial yet so powerful !!! Chandana Shroff – Chandana Shroff Feb 7 at 4:21
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.