Monthly Archives: October 2014

Troubleshooting Alfresco’s JMX Console Connections

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:

-Dcom.sun.management.jmxremote

This tells the running JVM to start the jmx service.

Make sure you have this in your alfresco-global.properties:

alfresco.rmi.services.port=50500
alfresco.rmi.services.host=<hostname>

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:

service:jmx:rmi:///jndi/rmi://<hostname>:50500/alfresco/jmxrmi

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:

<configRoot>/alfresco/alfresco-jmxrmi.access
<configRoot>/alfresco/alfresco-jmxrmi.password

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).

HTH,

H.S. :)

IMAP: Exposing one folder instead of the whole repository

I recently had a customer ask how he can expose a single folder as AlfrescoIMAP instead of exposing the whole repository by default. True, if you set up Alfresco’s IMAP out of the box, the whole repo is exposed in the Outlook client. In and of itself, this is not a bad thing. But, sometimes you may want to deal with one folder instead of the whole thing. Here’s how to do that. We’ll assume that you’ve gone into the “Company Home” directory which is effectively the top level of the repository and created a sub-directory there called “MyIMAProot”. You can then set the following in alfresco-global.properties:

imap.config.server.mountPoints.value.AlfrescoIMAP.rootPath=/app:company_home/cm:MyIMAProot

This should work after a restart but keep in mind that if some users try to configure their Outlook client and do not have access to the subdirectories, there is a bug that will keep Alfresco from rendering all subdirs since it gives up on the rest of cycling through if it encounters a folder it doesn’t have rights to. You can read more about that here:

https://issues.alfresco.com/jira/browse/MNT-12063

This will likely be ready when 4.2.4 comes out which isn’t far off. But for now, as long as your users have access to this folder and any subfolders within MyIMAProot, you should be good to go.

HTH,

H.S. :)

Getting FTP to work for AWS

If you are expecting to get FTP to work with Alfresco installed on AWS, you’ll find you get an error when you try to connect with your FTP client (FileZilla, lftp, gftp, etc.):

Error:	Connection timed out
Error:	Failed to retrieve directory listing

This can be a bit befuddling. How to fix this? Try these settings in your alfresco-global.properties file:

### FTP ###
ftp.dataPortFrom=8101
ftp.dataPortTo=8199

Make sure of course that you add this range (8101-8199) in your E2’s security group — it’s really the same thing as opening a port range in a router or firewall. Restart Alfresco and connect with your ftp client. Voila! It works!