Wednesday, November 17, 2010

Railo - CFChart - SOLVED Error: Probable fatal error:No fonts found

I built a new production server and launched the new site this morning. Everything ran great, except...

On one report page that I did not test before launch there was a small chart in the corner of the report. A <cfchart...> which was throwing this error: Probable fatal error:No fonts found.

After a quick search I discovered this is a font issue with OpenJDK which most people resolved by uninstalling OpenJDK and installing Sun's JDK.

I didn't want to do that. So I kept searching.


This error has two issues: 1) The fonts are not installed.  And/Or,  2) OpenJDK doesn't know where to find the fonts.

Tackle issue number 1 - get the fonts. This is a new server and trying to locate any of the fonts that others were installing came up blank.

sudo apt-get install libfreetype6 and restarting railo - didn't fix it anything.

sudo apt-get install dejavu* and restarting railo - didn't fix it.

I know those two commands installed a bunch of fonts, so I'm closer.

I kept researching and found these two articles which explained a lot more:

From the second link there I found the instructions to run a java command to register installed fonts in the java font properties.

sudo java -jar compilefontconfig.jar fontconfig.config fontconfig.bfc
 
but that command complained that it couldn't find fontconfig.config.

locate fontconfig.config showed it to be in /etc/java-6-openjdk/fontconfig.properties

I'm in /usr/lib/jvm/java-6-openjdk/jre/lib and the other file fontconfig.bfc is here, so I tried:

sudo java -jar compilefontconfig.jar /etc/java-6-openjdk/fontconfig.properties fontconfig.bfc

And that ran properly. No output, but no complaints.

Then I restarted railo and... IT WORKED! The CFChart displayed perfectly.


And that's a wrap!