Apache POI, translating Excel column number to letter

Recently I had to write some code to generate excel files using Apache POI. One of the files was fairly complex and used formulas in a few cells.

I found myself spending a few hours searching for a way to translate the indexed column numbers that POI uses to the column letters I needed in those formulas.

It turns out the solution is quite simple, you just have to use org.apache.poi.hssf.util.CellReference:

String columnLetter = CellReference.convertNumToColString(columnNumber);

Enabling remote JMX on Glassfish 2.1.1

The default glassfish app. server installation comes with local JMX connections enabled by default.

To enable JMX connections from remote hosts all that’s needed is to add -Djava.rmi.server.hostname=<hostname> in the JVM Options of the instance of GlassFish, where <hostname> is the external hostname of the server where glassfish is running.