flowable/flowable-engine · warning

Error while generating case diagram, image will not be…

Error message

Error while generating case diagram, image will not be stored in repository

What it means

CaseDefinitionDiagramHelper.createDiagramForCaseDefinition catches Throwable while generating the automatic diagram image for a deployed case definition and logs this warning instead of failing deployment. The generated diagram resource is dropped (returns null), so the case remains deployed and executable but has no auto-generated image in the repository.

Solutions

  1. Check the logged stack trace to identify the diagram-generation failure cause.
  2. Start the JVM with -Djava.awt.headless=true and ensure fonts are installed on the server.
  3. Provide an explicit diagram resource in the deployment instead of relying on generation.
  4. Ignore if images are unnecessary — deployment succeeds; this warning is non-fatal.

Example fix

// before
java -jar app.jar
// after
java -Djava.awt.headless=true -jar app.jar
Defensive patterns

Strategy: fallback

Validate before calling

// Ensure headless-safe environment before engine startup
if (GraphicsEnvironment.isHeadless()) System.setProperty("java.awt.headless", "true");

Try / catch

try { repositoryService.createCaseDeploymentBuilder().addClasspathResource("case.cmmn").deploy(); }
catch (Throwable t) { log.warn("Deployment issue, diagram may be absent but case is deployed", t); }

Prevention

When it happens

Trigger: Any exception/error during diagram generation — e.g. AWT/font/graphic environment failures on headless servers, CMMN model structures the diagram generator cannot render, or IO errors storing the resource.

Common situations: Running on headless JVMs without java.awt.headless=true or missing fonts; exotic CMMN elements breaking the diagram generator; disk/permission issues writing to the deployment resource store.

Understand the failure class

Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/906c3f59b1591d13. Report an issue: GitHub.

Appendix: source

Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/deployer/CaseDefinitionDiagramHelper.java:66

        try {
            byte[] diagramBytes = IoUtil.readInputStream(
                            cmmnEngineConfiguration.getCaseDiagramGenerator().generateDiagram(cmmnModel, "png",
                                            cmmnEngineConfiguration.getActivityFontName(),
                                            cmmnEngineConfiguration.getLabelFontName(),
                                            cmmnEngineConfiguration.getAnnotationFontName(),
                                            cmmnEngineConfiguration.getClassLoader()), null);
            String diagramResourceName = ResourceNameUtil.getCaseDiagramResourceName(
                            caseDefinition.getResourceName(), caseDefinition.getKey(), "png");

            resource.setName(diagramResourceName);
            resource.setBytes(diagramBytes);
            resource.setDeploymentId(caseDefinition.getDeploymentId());

            // Mark the resource as 'generated'
            resource.setGenerated(true);

        } catch (Throwable t) { // if anything goes wrong, we don't store the image (the case will still be executable).
            LOGGER.warn("Error while generating case diagram, image will not be stored in repository", t);
            resource = null;
        }

        return resource;
    }

    protected CmmnResourceEntity createResourceEntity() {
        return CommandContextUtil.getCmmnEngineConfiguration().getCmmnResourceEntityManager().create();
    }

    public boolean shouldCreateDiagram(CaseDefinitionEntity caseDefinition, EngineDeployment deployment) {
        if (NativeUtil.inNativeImage()) {
            // Do not create diagram in native image
            return false;
        }
        if (deployment.isNew() && caseDefinition.hasGraphicalNotation()
                && CommandContextUtil.getCmmnEngineConfiguration().isCreateDiagramOnDeploy()) {

View on GitHub (pinned to d6d39ce1c6)