Legacy Knowledge Base
Published Jun. 30, 2025

When we enable captcha in forms, it doesn't show up

Written By

Jorge García Jiménez

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • When we enable captcha in forms, it doesn't show up and below exception appears in the logs
    Caused by: java.lang.NullPointerException
    at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262)
    at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225)
    at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:107)
    at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719)
    at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:377)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.desktop/sun.font.SunFontManager.<init>(SunFontManager.java:322)
    at java.desktop/sun.awt.FcFontManager.<init>(FcFontManager.java:35)
    at java.desktop/sun.awt.X11FontManager.<init>(X11FontManager.java:56)
    ... 105 more
    Exception in thread "http-nio-8080-exec-13" java.lang.InternalError: java.lang.reflect.InvocationTargetException
    at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:86)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
    at java.desktop/java.awt.Font.getFont2D(Font.java:497)
    at java.desktop/java.awt.Font$FontAccessImpl.getFont2D(Font.java:237)
    at java.desktop/sun.font.FontUtilities.getFont2D(FontUtilities.java:158)
    at java.desktop/sun.font.StandardGlyphVector.initFontData(StandardGlyphVector.java:1132)
    at java.desktop/sun.font.StandardGlyphVector.init(StandardGlyphVector.java:1121)
    at java.desktop/sun.font.StandardGlyphVector.<init>(StandardGlyphVector.java:167)
    at java.desktop/java.awt.Font.createGlyphVector(Font.java:2734)
    at nl.captcha.text.renderer.DefaultWordRenderer.render(Unknown Source)
    at nl.captcha.Captcha$Builder.addText(Unknown Source)
    at com.liferay.captcha.simplecaptcha.SimpleCaptchaImpl.getSimpleCaptcha(SimpleCaptchaImpl.java:223)
    at com.liferay.captcha.simplecaptcha.SimpleCaptchaImpl.serveImage(SimpleCaptchaImpl.java:132)
    at com.liferay.captcha.util.CaptchaUtil.serveImage(CaptchaUtil.java:92)
    at com.liferay.captcha.taglib.internal.struts.GetCaptchaImageStrutsAction.execute(GetCaptchaImageStrutsAction.java:39)

Environment

  • Liferay DXP 7.4 with JDK 11.0.15

Resolution

  • JDK 11 doesn't bring fontconfig, so you have to install it manually. Per example using:
    • apk add --no-cache fontconfig ttf-dejavu
    • yum install fontconfig

Additional Information

 

Did this article resolve your issue ?

Legacy Knowledge Base