Could not initialize class net.sourceforge.plantuml.ugraphic.UFont

0 votes
asked Jun 18 in Question / help by anonymous
edited Jun 18


When we tried to use the plantuml lib to generate call flow diagrams, we've got the following exception.

java.lang.NoClassDefFoundError: Could not initialize class net.sourceforge.plantuml.ugraphic.UFont
at net.sourceforge.plantuml.graphic.GraphicStrings.sansSerif12(
at net.sourceforge.plantuml.graphic.GraphicStrings.createBlackOnWhite(
at net.sourceforge.plantuml.UmlDiagram.exportDiagramError(
at net.sourceforge.plantuml.UmlDiagram.exportDiagramError(
at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(
at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(
at net.sourceforge.plantuml.SourceStringReader.outputImage(
at net.sourceforge.plantuml.SourceStringReader.outputImage(

Our environment is: plantuml 1.2020.12, tomcat 7.0.94,  and openJDK 1.8.0_252-b09 in virtual linux.

Any solution to solve this issue? Thanks.


commented Jun 19 by Serge Wenger Work (12,800 points)
Please provide a small example to help reproduce
commented Jun 24 by anonymous
something like:

String text = "@startuml\n" +

"Alice -> Bob: Authentication Request\n" +

"Bob --> Alice: Authentication Response\n" +


    private URI generateCallflowDiagram(String text, String outputFile) {

        try {

  "generateCallflowDiagram: " + text + " outputFile=: " + outputFile);

            SourceStringReader reader = new SourceStringReader(text);

  "sourcestringreader made");

            final ByteArrayOutputStream os = new ByteArrayOutputStream();

  "bytearrayoutputstream created");

            String desc = reader.outputImage(os, new FileFormatOption(FileFormat.SVG)).getDescription();

  "image generated");



Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.