fontconfig, Java, and Domino 11

Jan 29, 2021, 12:09 PM

Tags: java
  1. AbstractCompiledPage, Missing Plugins, and MANIFEST.MF in FP10 and V10
  2. Domino 11's Java Switch Fallout
  3. fontconfig, Java, and Domino 11
  4. Notes/Domino 12.0.2 Fallout
  5. Notes/Domino 14 Fallout

In my last post, I quickly mentioned some trouble I had run into with fontconfig and Poi, in the context of configuring a Docker-based Domino server. However, I think it deserves its own post, so I have something to point to if others run into the same trouble down the line.

The Upshot

The upshot of the issue is that, if you're going to use Poi or or other graphics-adjacent Java libraries in Domino 11 on Linux, you'll need fontconfig and potentially some other support files installed on your system. If you have any GUI stuff installed, they'll probably be there, but it's common for them to be missing on headless servers.

For the official Domino Docker image, which uses Red Hat's package system, I wrote this Dockerfile for my derivative version:

FROM domino-docker:V1101FP2_10202020prod
USER root
RUN yum install --assumeyes fontconfig urw-fonts
USER notes

On Debian-based systems, I believe you just need apt install fontconfig.

The Details

AdoptOpenJDK builds of Java apparently don't include the same font-related support files that the Oracle ones did, and that results in calls made to the AWT layer to throw NullPointerExceptions at various times related to getting font information. This has shown up in a couple issues over in the openjdk-support project on GitHub, with two representative ones being:

  at sun.awt.FcFontManager.getDefaultPlatformFont(
  at sun.font.SunFontManager$

  at sun.awt.FontConfiguration.getVersion(
  at sun.awt.FontConfiguration.readFontConfigFile(
  at sun.awt.FontConfiguration.init(

Domino 11 switched from IBM's proprietary variant of J9 to OpenJ9, and this is another one of the little fiddly details that isn't quite the same between the two.

Most commonly, I've found this crop up when using Poi, specifically calling autosizeColumns when generating a spreadsheet, but in theory any number of things like that will trip across this. Unfortunately, the internal JVM classes aren't terribly helpful in their error reporting, since they get several method calls in just assuming that all is well with the world before bailing with the NPEs like above.

It's a mild annoyance to deal with, but fortunately one with a straightforward fix, at least once you know what the trouble is.

Commenter Photo

tommaso - May 3, 2021, 1:12 PM

Hi, I'm running Domino 11FP2 on CentOS 8 .

with the Poi sheet.autoSizeColumn function I experienced exactly the java.lang.NullPointerException at sun.awt.FontConfiguration.getVersion(

error even avter installing fontconfig urw-fonts

Than I tried (after this : providing a and the error changed to

java.lang.NullPointerException at sun.awt.FcFontManager.getDefaultPlatformFont(

Can you suggest something? thanks a lot tommaso

Commenter Photo

Jesse Gallagher - May 10, 2021, 12:54 PM

Hmm, that's odd - the fontconfig/urw-fonts route worked well for my Docker image, but I haven't run Domino on actual CentOS. Maybe there's something else to it, though it's still surprising.

Commenter Photo

Ayhan - May 23, 2022, 1:06 PM

11 years later - this helped us a lot - thanks champ

New Comment