Most of the time, I can get jconsole to make a JMX connection to a running instance of Alfresco but there are times when I will run into issues or a customer simply can’t seem to make it work. Below are some troubleshooting steps to getting JMX working and make a connection to it.
Make sure that the Alfresco server does not have a NAT network connection. If you’re not sure what this is, you can ask your network administrator to check and tell you for sure. I realize I have this first in the list but usually this isn’t the cause. I would suspect this as the issue only if the following troubleshooting fails and you simply can’t get it working.
Make sure you have this somewhere in your java_opts:
This tells the running JVM to start the jmx service.
Make sure you have this in your alfresco-global.properties:
The <hostname> should be resolvable using ping from the workstation from where you are running jconsole.
Make sure you connect with the jconsole in the java/bin/ using the JDK you’re using to run Alfresco with. In other words, you may have another JDK installed elsewhere and jconsole from that JDK may be on your path. It’s a good idea to do a `whereis jconsole` to see which path it comes from. If nothing else, go directly to the java/bin directory in your Alfresco install and use the jconsole executable there. This is the standard url to use when connecting:
If you’re running this on the local server, you may want to try localhost for hostname. In any case, make sure that <hostname> is set to a reachable domain name on the network. IP Address might not be a bad idea either.
If you haven’t changed the username/password for JMX, the default is:
userid: controlRole password: change_asap
The ‘change_asap’ password should be a hint to change it as soon as you can. If you simply can’t remember the username/password combo, they should be revealed in these files:
With all these things satisfied and Alfresco started, you can test on the Alfresco server to make sure the JMX rmi service is running by either issuing these from the command line:
# lsof -i :50500 (for Linux) # netstat -an (for Windows)
With Windows you can probably use the /find switch to look for port 50500 in the listing specifically or you can scroll through the output to look for 50500.
Next, from the client workstation, you can test connectivity to the JMX rmi port by first pinging the server’s hostname. After this, check for port opening from your workstation by issuing:
# telnet <hostname> 50500
You’ll know this is open by getting a blank screen instead of the “unable to connect” message or something similar.
If none of these work, then have your network admin see if your server is set up with NAT addressing. This can cause problems with any of the RMI services (of which JMX is related).