Neven, thx for your reply,
so my question is why when I start my own main without passing -Dcom.sun.management.* properties I can connect to it with jconsole, but I cannot connect with jconsole to tomcat (although it is visible in jconsole) ? both my main, and tomcat, and jconsole are running on the same laptop. regards, Jakub On Sun, Apr 7, 2013 at 3:49 PM, Neven Cvetkovic <neven.cvetko...@gmail.com>wrote: > Jakub, > > "You don't have to" configure Tomcat with above settings to get JMX. You > are correct that JMX works out of the box. However, that works only > locally, above commands are for REMOTE JMX access. You are opening up a jmx > port so external (not same machine) jconsole or jvirtualvm can access JMX > MBean server your Tomcat is running. Thus, if you want to connect to remote > Tomcat instance, "you have to provide" JMX connection details, and that's > what we often do. > > The above settings are best configured in CATALINA_HOME/bin/setenv.bat or > setenv.sh script that you need to create. Even though this script doesn't > exist by default, startup script calls it if it is created by user. All > your customizations should be contained there. > > Hope that helps. Cheers! > On Apr 7, 2013 5:59 AM, "Jakub 1983" <jjaku...@gmail.com> wrote: > > > why do I have to enable jmx with command > > > > *set CATALINA_OPTS=-Dcom.sun.management.jmxremote \ > > -Dcom.sun.management.jmxremote.port=%my.jmx.port% \ > > -Dcom.sun.management.jmxremote.ssl=false \ > > -Dcom.sun.management.jmxremote.authenticate=false* > > > > > > http://tomcat.apache.org/tomcat-7.0-doc/monitoring.html > > > > even when I run it *under java 6* ? > > in java 6 jmx is active by default (it is active when I run my own main), > > I cannot see how it is disabled by default by tomcat start scripts, > > but when I run default startup, I cannot connect with jconsole, > > when I set CATALINA_OPTS as above, it works fine, > > but why doesn't it work without it ? > > > > regards > > Jakub > > >