On 4/7/2013 7:54 AM, Jakub 1983 wrote:
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




Works for me . . . I just started my Tomcat 7.0.39 with Java 6 and a Java 6 version of jconsole connects right up:

Environment:

OS: Windows 7 Home Premium 64 bit
JRE / JDK: 1.6.0_43
Tomcat: 7.0.39

I have a setenv.bat with:

set "JRE_HOME=C:\Program Files\Java\jre6"

since my normal environment is JRE / JDK 7.

Maybe your Windows firewall isn't configured to allow Java network connections? However that wouldn't explain why it works when JMX is configured.

. . . . just my two cents.
/mde/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to