{"record":{"id":"906c3f59b1591d13","repo":"flowable/flowable-engine","slug":"error-while-generating-case-diagram-image-will-no","errorCode":null,"errorMessage":"Error while generating case diagram, image will not be stored in repository","messagePattern":"Error while generating case diagram, image will not be stored in repository","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/deployer/CaseDefinitionDiagramHelper.java","lineNumber":66,"sourceCode":"        try {\n            byte[] diagramBytes = IoUtil.readInputStream(\n                            cmmnEngineConfiguration.getCaseDiagramGenerator().generateDiagram(cmmnModel, \"png\",\n                                            cmmnEngineConfiguration.getActivityFontName(),\n                                            cmmnEngineConfiguration.getLabelFontName(),\n                                            cmmnEngineConfiguration.getAnnotationFontName(),\n                                            cmmnEngineConfiguration.getClassLoader()), null);\n            String diagramResourceName = ResourceNameUtil.getCaseDiagramResourceName(\n                            caseDefinition.getResourceName(), caseDefinition.getKey(), \"png\");\n\n            resource.setName(diagramResourceName);\n            resource.setBytes(diagramBytes);\n            resource.setDeploymentId(caseDefinition.getDeploymentId());\n\n            // Mark the resource as 'generated'\n            resource.setGenerated(true);\n\n        } catch (Throwable t) { // if anything goes wrong, we don't store the image (the case will still be executable).\n            LOGGER.warn(\"Error while generating case diagram, image will not be stored in repository\", t);\n            resource = null;\n        }\n\n        return resource;\n    }\n\n    protected CmmnResourceEntity createResourceEntity() {\n        return CommandContextUtil.getCmmnEngineConfiguration().getCmmnResourceEntityManager().create();\n    }\n\n    public boolean shouldCreateDiagram(CaseDefinitionEntity caseDefinition, EngineDeployment deployment) {\n        if (NativeUtil.inNativeImage()) {\n            // Do not create diagram in native image\n            return false;\n        }\n        if (deployment.isNew() && caseDefinition.hasGraphicalNotation()\n                && CommandContextUtil.getCmmnEngineConfiguration().isCreateDiagramOnDeploy()) {\n","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/deployer/CaseDefinitionDiagramHelper.java#L48-L84","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the logged stack trace to identify the diagram-generation failure cause.","Start the JVM with -Djava.awt.headless=true and ensure fonts are installed on the server.","Provide an explicit diagram resource in the deployment instead of relying on generation.","Ignore if images are unnecessary — deployment succeeds; this warning is non-fatal."],"exampleFix":"// before\njava -jar app.jar\n// after\njava -Djava.awt.headless=true -jar app.jar","handlingStrategy":"fallback","validationCode":"// Ensure headless-safe environment before engine startup\nif (GraphicsEnvironment.isHeadless()) System.setProperty(\"java.awt.headless\", \"true\");","typeGuard":null,"tryCatchPattern":"try { repositoryService.createCaseDeploymentBuilder().addClasspathResource(\"case.cmmn\").deploy(); }\ncatch (Throwable t) { log.warn(\"Deployment issue, diagram may be absent but case is deployed\", t); }","preventionTips":["Run JVMs with -Djava.awt.headless=true and fonts installed.","Ship an explicit diagram resource if your CI verifies diagram presence.","Treat this warning as non-fatal; verify the case definition still deployed and is executable."],"tags":["cmmn","diagram","deployment","headless","awt"],"backgroundTag":"file-write-failed","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}