Local and Remote JMX Connections
There are two ways to connect to Nexus using JMX - locally and remotely.
Local connections are possible without any extra configuration as long as the following conditions are met:
- VisualVM and Nexus are running as the same user id
- VisualVM and Nexus use the exact same Java version and architecture: Example 64 bit Java 7 for both.
Remote connections require explicit configuration changes.
Locally Connecting with VisualVM on Windows
Nexus usually runs as a Windows Service. Connecting to a Windows service using a local VisualVM install is particularly challenging. Here are some resources to help:
Configure JMX in the Standard Nexus Bundle zip/tar.gz
Below are steps for Nexus versions 2.8 and higher.
1. Add the following property to
Adjust the sequence number (shown here as "3") to be in line with the other wrapper.java.parameter lines.
2. Add the following properties to NEXUS_HOME/conf/nexus.properties
Ensure that a remotely accessible IP address is set for jmx-host to allow remote jmx access. It is important to ensure that the port is not blocked by any network setup, when connecting remotely. The value of 1099 is the default port used for JMX, but any other available port can be used as well.
3. Restart Nexus.
Below are steps for Nexus versions older than 2.8
Newer versions of Nexus have a <installation_dir>/conf/examples/jetty-jmx.xml file which can be used to configure JMX. Simply copy the differences from jetty-jmx.xml into <installation_dir>/conf/jetty.xml while nexus is stopped.
Note: If you want to be able to connect to JMX from a remote host you will need to add this line to <nexus_root>/bin/jsw/conf/wrapper.conf:
Adjust the sequence number (shown here as "4") to be in line with the other wrapper.java.additional lines.
Tip: To enable Mbeans for the JSW watchdog process add the following line to the wrapper.conf file:
Configure JMX with the Nexus Professional Trial Installer
The trial installation uses an Install4j installer and not Java Service Wrapper, therefore configuring JMX via JVM properties is slightly different from the regular bundles.
Find the Nexus installation directory. An easy way to do this is using the Nexus Control application - look for the "Installation" directory.
Edit the "<installation_directory>/bin/nexus.vmoptions" file and add the following lines:
-Dcom.sun.management.jmxremote.port=1099 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false
Restart nexus for the settings to take effect.
Important: For ease of use, we turn off the requirement to authenticate or use SSL when making the connection. Understand that some environments may treat this as a security risk. Since the aim of these instructions are to get you going as quickly as possible, we turn these options off here.
Important: Choose a port that is not already in use and can be accessed through firewalls. Ask your IT staff for guidance.
Remotely Connecting with VisualVM
Download Visual VM or launch jvisualvm from your JDK's bin directory. Click on "add jmx connection", and enter the IP address of the nexus host and the port you configured above. Example: "192.168.2.1:1099"