Forum Stats

  • 3,838,003 Users
  • 2,262,319 Discussions


Null Pointer Exception at sun.awt.X11FontManager.getFontPath(

Trying to look for any clues on a simple Graphics code which is reporting Null Pointer Exception with the stack below :


    at sun.awt.X11FontManager.getFontPath(

    at sun.font.SunFontManager.getPlatformFontPath(

    at sun.awt.X11FontManager.getFileNameFromPlatformName(

    at sun.font.SunFontManager.initCompositeFonts(

    at sun.font.SunFontManager.access$700(

    at sun.font.SunFontManager$

    at Method)

    at sun.font.SunFontManager.<init>(

    at sun.awt.FcFontManager.<init>(

    at sun.awt.X11FontManager.<init>(

    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    at sun.reflect.NativeConstructorAccessorImpl.newInstance(

    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(

    at java.lang.reflect.Constructor.newInstance(

    at java.lang.Class.newInstance(

    at sun.font.FontManagerFactory$

    at Method)

    at sun.font.FontManagerFactory.getInstance(

    at java.awt.Font.getFont2D(

    at java.awt.Font.defaultLineMetrics(

    at java.awt.Font.getLineMetrics(

"sun.awt.X11FontManager.getFontPath" is defined on which is available here :

This is on AIX with Java version :

java version "1.8.0_191"

Java(TM) SE Runtime Environment (build - pap6480sr5fp27-20190104_01(SR5 FP27))

IBM J9 VM (build 2.9, JRE 1.8.0 AIX ppc64-64-Bit Compressed References 20181219_405297 (JIT enabled, AOT enabled)

OpenJ9 - 3f2d574

OMR   - 109ba5b

IBM   - e2996d1)

JCL - 20190104_01 based on Oracle jdk8u191-b26

Sample program to recreate this error is attached. We compile and run this within the Oracle database , however something similar from the command line also reports the same stack.

We have checked DISPLAY is not set , this is a HeadLess environment and the Font packages are installed.

This appears to be an environment specific issue as the same code appears to be working on other AIX boxes with an similar JDK setup.

Would appreciate any pointers / things to check to get past this Null Pointer exception