Legacy Knowledge Base
Published Sep. 10, 2025

DXP Fails to Generate Captchas and Charts on RHEL 7.4

Written By

Christopher Lui

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.

When using RHEL 7.4, and viewing a captcha, or when navigating to Control Panel > Configuration > Server Administration, the following stack trace will appear in the application server logs. That is catalina.out for Tomcat.

Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
        at sun.font.CompositeStrike.getStrikeForSlot(CompositeStrike.java:75)
        at sun.font.CompositeStrike.getFontMetrics(CompositeStrike.java:93)
        at sun.font.FontDesignMetrics.initMatrixAndMetrics(FontDesignMetrics.java:359)
        at sun.font.FontDesignMetrics.<init>(FontDesignMetrics.java:350)
        at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:302)
        at sun.java2d.SunGraphics2D.getFontMetrics(SunGraphics2D.java:855)
        at org.jfree.text.G2TextMeasurer.getStringWidth(G2TextMeasurer.java:79)
        at org.jfree.text.TextUtilities.nextLineBreak(TextUtilities.java:294)
        at org.jfree.text.TextUtilities.createTextBlock(TextUtilities.java:235)
        at org.jfree.chart.title.TextTitle.arrangeRR(TextTitle.java:632)
        at org.jfree.chart.title.TextTitle.arrange(TextTitle.java:501)
        at org.jfree.chart.JFreeChart.drawTitle(JFreeChart.java:1321)
        at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1209)
        at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1409)
        at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1389)
        at org.jfree.chart.ChartUtilities.writeChartAsPNG(ChartUtilities.java:183)
        at org.jfree.chart.ChartUtilities.writeChartAsPNG(ChartUtilities.java:136)
        at com.liferay.server.admin.web.internal.portlet.action.ViewChartMVCResourceCommand.doServeResource(ViewChartMVCResourceCommand.java:108)
        at com.liferay.portal.kernel.portlet.bridges.mvc.BaseMVCResourceCommand.serveResource(BaseMVCResourceCommand.java:41)
        ... 168 more

You may also encounter this stack trace result when using related operating systems, such as Fedora or CentOS.

The issue occurs because of issues with OpenJDK 1.8.0.141-2 in Red Hat 7.4 and its default font package, Stix. See the following links for reference.

Resolution

There are two known resolutions and one workaround:

  1. Revert the Stix font back to Utopia fonts
  2. Update to an OpenJDK version newer than 1.8.0.141-2

Workaround:

  1. In some scenarios installing dejavu fonts fixes the problem:
yum install dejavu-serif-fonts
yum install dejavu-sans-fonts
yum install dejavu-fonts-common
Did this article resolve your issue ?

Legacy Knowledge Base