Sun GlassFish Enterprise Server 2.1 Administration Guide

Using JConsole

This section contains the following topics:

Administration (management and monitoring) of the Enterprise Server is based on JMX Technology. This means that the managed components are represented as MBeans in the MBeanServer running in the Enterprise Server's JVM.

Java SE 5 enhances management and monitoring of the JVM by including a Platform MBean Server and by including MBeans to configure the JVM. Enterprise Server leverages these enhancements and registers its MBeans with the Platform MBean Server. Thus a JMX Connector Client gets a unified view of JVM MBeans as well as Enterprise Server MBeans.

To view all the MBeans, Enterprise Server provides a configuration of the Standard JMX Connector Server called System JMX Connector Server. As part of Enterprise Server startup, an instance of this JMX Connector Server is started. Any compliant JMX connector client can connect to the server using this Connector Server.

Java SE also provides tools to connect to an MBean Server and view MBeans registered with it. JConsole is one such popular JMX Connector Client and is available as part of the standard Java SE distribution. For more information on JConsole, see http://java.sun.com/javase/6/docs/technotes/guides/management/jconsole.html

When you configure JConsole with Enterprise Server, Enterprise Server becomes the JMX Connector's server end and JConsole becomes the JMX Connector's preferred client end. Connecting JConsole to Application Servershows how to make a successful connection .

Securing JConsole to Application Server Connection

There are subtle differences in how to connect to Enterprise Server, or any JMX Connector Server end, based on the transport layer security of the connection. If the server end is secure (guarantees transport layer security), there is a little more configuration to be performed on the client end.

When you install a developer profile domain on a machine such as appserver.sun.com, you will see the following in the Domain Administration Server (DAS) domain.xml file:

<!- – The JSR 160 "system-jmx-connector" – –><jmx-connector accept-all="false" address="0.0.0.0" auth-realm-name="admin-realm" enabled="true" name="system" port="8686" protocol="rmi_jrmp" security-enabled="false"/><!- – The JSR 160 "system-jmx-connector" – –>

The security-enabled flag for the JMX Connector is false. If you are running the cluster or enterprise profile, or if you have turned on security for the JMX Connector in the developer profile, this flag is set to true.

<!- – The JSR 160 "system-jmx-connector" – –><jmx-connector accept-all="false" address="0.0.0.0" auth-realm-name="admin-realm" enabled="true" name="system" port="8686" protocol="rmi_jrmp" security-enabled="true"/>...</jmx-connector><!- – The JSR 160 "system-jmx-connector" – –>

Prerequisites for Connecting JConsole to Application Server

The JConsole setup has two parts: a server end and a client end. For this example, the Enterprise Server domain is installed on a machine called appserver.sun.com, which is a powerful Solaris server. This is the server end.

The client end also has an installation of Enterprise Server. Let us assume that the client end is a Windows machine with Java SE 6.0 and Enterprise Server installed.


Note –

The Enterprise Server installation is needed on the client end only when your Enterprise Server domain has security enabled on the remote machine (the default for cluster and enterprise profiles). If you just want to administer an Enterprise Server developer profile domain on the Solaris machine above, you do not need the Enterprise Server installation on this client machine.


If the server and client ends are on the same machine, you can use localhost to specify the host name.

ProcedureConnecting JConsole to Application Server

This procedure describes connecting JConsole to Enterprise Server without security enabled on the JMX Connector. By default, security is not enabled on Enterprise Server for the developer profile.

  1. Start the domain on appserver.sun.com.

  2. Start JConsole by running JDK_HOME/bin/jconsole.

  3. In the Connect to Agent tab of JConsole, enter user name, password, host name and port (8686, by default).

    The user name refers to the administration user name and password refers to the administration password of the domain.

  4. Click Connect.

    In the JConsole window you will see all your MBeans, VM information etc., in various tabs.

ProcedureConnecting JConsole Securely to Application Server

This procedure describes how to connect JConsole to Enterprise Server with security enabled on the JMX Connector. By default, security is enabled on Enterprise Server cluster or enterprise profiles. Use this procedure if you have security enabled on the developer profile's JMX Connector.

  1. Install Enterprise Server on the client machine (where JConsole is installed).

    The only reason you need this is to let JConsole know where the server certificate of the Domain Administration Server that you trust is located. To obtain that certificate, invoke at least one remote asadmin command and to do that, you need the local installation of Enterprise Server.

  2. Start the Enterprise Server on appserver.sun.com.

    Since this is a cluster or enterprise domain, the system JMX Connector server is secure. To enable security on the developer profile JMX Connector, see the Admin Console online help.

  3. From the local Enterprise Server installation, run install-dir\bin\asadmin list --user admin --secure=true --host appserver.sun.com --port 4848 (where 4848 is the server's administration port).

    Though asadmin list command is chosen for this example, you can run any remote asadmin command. You are prompted to accept the certificate sent by the DAS of appserver.sun.com.

  4. Press y to accept the certificate sent by the DAS on appserver.sun.com.

    The server's certificate is stored in a file called .asadmintruststore in your home directory on the client machine.


    Note –

    This step is not required if your server machine and client machine is the same. That is, if you are running JConsole also on appserver.sun.com.


  5. Let JConsole know the trust store location by using the following JConsole command:

    JDK-dir\bin\jconsole.exe -J-Djavax.net.ssl.trustStore="C:\Documents and Settings\user\.asadmintruststore"

  6. Start JConsole by running JDK_HOME/bin/jconsole

  7. In the Connect to Agent tab of JConsole, enter user name, password, host name and port (8686, by default).

    The user name refers to the administration user name and password refers to the administration password of the domain.

  8. Click Connect.

    In the JConsole window you will see all your MBeans, VM information etc., in various tabs.