문제

I am using jdk64 and my java version is 1.6.0_24. I am running both (Tomcat java process and VisualVM) processes as Administrator on Windows Server 2008.

Tomcat is running with -Xmx7196m, where as jvisualvm is running with -Xms24m and -Xmx256m. Could this be the cause?

도움이 되었습니까?

해결책

You need to add the JMX parameters to enable the JMX connection to your application, so add the following parameters:

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.port=8484
-Dcom.sun.management.jmxremote.ssl=false

Then You need to add your tomcat process manually, So right click on you localhost node -> Add JMX Connection -> type your port -> OK.

Your tomcat process will be listed in under localhost node.

다른 팁

Our application server is JBOSS 6.1.0.final and our server itself is not starting on adding these lines to the run.conf.bat file -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=8484 -Dcom.sun.management.jmxremote.ssl=false

The reason VisualVM cannot find Java because of OS process privileges.

If you start VisualVM with the same user & security context as Java app you will see it: VisualVM will gain access to sockets, /proc fs, etc...

To workaround the OS security stuff you can expose your Java app via JMX appending sys props:

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.port=[...PORT...]
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=localhost

java.rmi.server.hostname is an important security measure to prevent connection to your app JMX from outside. If you need a remote connection just pass the port with SSH tunnel.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top