NexJ Logo

Viewing JMX statistics remotely

You can view JMX statistics remotely in JConsole. You run JConsole with the nexj-jmxclient.jar file on its classpath. You run JConsole using the jconsole.bat Windows batch file or jconsole.sh Linux shell file.

This functionality is supported for NexJ Server only.

To view JMX statistics remotely:

  1. Create a CLIENT_JAR environment variable that specifies the location of the  nexj-jmxclient.jar file. By default, the nexj-jmxclient.jar file is located in the <NEXJ_PLUGIN> directory.

    If you do not define the CLIENT_JAR environment variable, you must place the the nexj-jmxclient.jar file and the jconsole.bat or jconsole.sh file in the same directory. By default, the jconsole.bat and jconsole.sh files are located in the <NEXJ_PLUGIN>\enterprise\etc\config\teee directory.

  2. To run JConsole, do one of the following:
    • In Windows, run the jconsole.bat file.
    • In Linux, run the jconsole.sh file.
    JConsole launches and the New Connection dialog opens.
  3. In the Remote Process field enter the JMXServiceURL as follows: 
    service:jmx:http(s)://<application_hostname>:<port>/<contextRoot>/jmx
    where:
    • application_hostname
      Specifies the application host name.
    • port
      Specifies the port number of the application host or web server. It is recommended to connect to the node directly in a clustered environment. Otherwise, if the session is redirected to a different node by the web server, the JMX client may receive an error and a manual reconnect may be required.

    • contextRoot
      Specifies the context root of the web application.

    where
    For example: service:jmx:https://app-server-01:443/nexj/jmx
  4. Provide credentials for NexJ System Admin Console in the Username and Password fields.

JMX statistics display for NexJ Server in JConsole.

You can connect to JMX clients located on the same internal network as NexJ Server when connecting directly to the nodes. If you want to access statistics from an external client, you must either open the node’s port in the firewall, or connect through the default web server port, which is typically 80 or 443.