How to enable remote JVM monitoring using jre's built in JConsole
Tech-Today

How to enable remote JVM monitoring using jre's built in JConsole


This guide will help you setup a remote jvm monitoring tool using jconsole.

The setup:
1.) Ubuntu 12.04
2.) Glassfish 3.1.2.2
3.) jdk1.6.0_32

Steps:
1.) In your glassfish's default domain1 domain.xml file, /glassfish_home/glassfish/domains/domain1/config/domain.xml, add the following lines in the jvm section:
<jvm-options>-Djava.net.preferIPv4Stack=true</jvm-options>
<jvm-options>-Dcom.sun.aas.jconsole.server.cbport=18687</jvm-options>
<jvm-options>-Dcom.sun.management.jmxremote.ssl=false</jvm-options>
<jvm-options>-Dcom.sun.management.jmxremote.authenticate=false</jvm-options>
<jmx-connector address="0.0.0.0" auth-realm-name="admin-realm" name="system" port="18686" protocol="rmi_jrmp" security-enabled="false"/>

//you can set the fully qualified domain name if you have, otherwise we will connect using ip
<jvm-options>-Djava.rmi.server.hostname=mydomain.com
2.) Rename /usr/lib/jvm/jdk1.6.0_32/jre/lib/management/jmxremote.password.template->/usr/lib/jvm/jdk1.6.0_32/jre/lib/management/jmxremote.password

3.) Uncomment monitorRole and controlRole users

4.) Change the owner of /usr/lib/jvm/jdk1.6.0_32/jre/lib/management/jmxremote.password, the same as the owner of glassfish folder:
sudo chown owner:group /usr/lib/jvm/jdk1.6.0_32/jre/lib/management/jmxremote.password
sudo chmod 600 /usr/lib/jvm/jdk1.6.0_32/jre/lib/management/jmxremote.password

5.) Restart glassfish and connect from a remote machine using JConsole, enter the IP and port 8686. Example: 192.168.0.106:8686




- Javaee Development
JavaEE6How to create a javaee6 web app using jboss maven war archetypeCreate a simple javaee6 web app with maven, glassfish and postgresqlHow to validate a JavaEE6 Bean in a jobHow to add JavaEE 6 archetypes in eclipse keplerHow to create a custom bean...

- How To Install Jdk 1.6 Update 32 On Ubuntu 11.10
Currently Oracle prohibit the community from adding java to the linux repositories. So it needed to be manually download from oracle website and installed. Java can be downloaded from: From: http://www.devsniper.com/ubuntu-12-04-install-sun-jdk-6-7/...

- How To Install Logback Logger In Glassfish 3.1.1
How to install Logback Logger in Glassfish 3.1.1 1.) Download the ff jars: a.) slf4j-api.jar b.) jul-to-slf4j.jar c.) logback-classic.jar d.) logback-core.jar 2.) Copy the jars mentioned above in {glassfish_home}/glassfish/lib/endorsed. 3.) Modify...

- How To Install And Setup Glassfish
1.) Download glassfish installer from http://download.java.net/glassfish/3.1.1/release/glassfish-3.1.1.zip 2.) Unzip in {your_choice}/glassfish-3.1.1 3.) Create 'startup' script file as follows: 4.) Create mydomain domain in glashfish: {your_choice}/glassfish-3.1.1/bin/asadmin...

- How To Enable Slf4j Logging In Glassfish 3.1.1
This blog entry will try to setup slf4j as the main logger for glassfish 3.1.1 What you need: 1.) Glassfish 3.1.1 (zipped) 2.) Download the ff jars:   a.) slf4j-api.jar   b.) jul-to-slf4j.jar   c.) logback-classic.jar...



Tech-Today








.