{"record":{"id":"f91e572f15cd3054","repo":"flowable/flowable-engine","slug":"error-while-generating-decision-requirements-diagr","errorCode":null,"errorMessage":"Error while generating decision requirements diagram, image will not be stored in repository","messagePattern":"Error while generating decision requirements diagram, image will not be stored in repository","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/deployer/DecisionRequirementsDiagramHelper.java","lineNumber":65,"sourceCode":"        try {\n            byte[] diagramBytes = IoUtil.readInputStream(\n                    dmnEngineConfiguration.getDecisionRequirementsDiagramGenerator().generateDiagram(dmnDefinition, \"png\",\n                            dmnEngineConfiguration.getDecisionFontName(),\n                            dmnEngineConfiguration.getLabelFontName(),\n                            dmnEngineConfiguration.getAnnotationFontName(),\n                            dmnEngineConfiguration.getClassLoader()), null);\n            String diagramResourceName = ResourceNameUtil.getDecisionRequirementsDiagramResourceName(\n                    decision.getResourceName(), decision.getKey(), \"png\");\n\n            resource.setName(diagramResourceName);\n            resource.setBytes(diagramBytes);\n            resource.setDeploymentId(decision.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 decision will still be executable).\n            LOGGER.warn(\"Error while generating decision requirements diagram, image will not be stored in repository\", t);\n            resource = null;\n        }\n\n        return resource;\n    }\n\n    protected DmnResourceEntity createResourceEntity() {\n        return CommandContextUtil.getDmnEngineConfiguration().getResourceEntityManager().create();\n    }\n\n    public boolean shouldCreateDiagram(DecisionEntity decision, EngineDeployment deployment) {\n        if (deployment.isNew() && decision.hasGraphicalNotation()\n                && CommandContextUtil.getDmnEngineConfiguration().isCreateDiagramOnDeploy()) {\n\n            // If the 'getDecisionRequirementsDiagramResourceNameFromDeployment' call returns null, it means\n            // no diagram image for the decision was provided in the deployment resources.\n            return ResourceNameUtil.getDecisionRequirementsDiagramResourceNameFromDeployment(decision, deployment.getResources()) == null;\n        }","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-engine/src/main/java/org/flowable/dmn/engine/impl/deployer/DecisionRequirementsDiagramHelper.java#L47-L83","documentation":"A WARN-level message logged by DecisionRequirementsDiagramHelper.createDiagramForDecision when any Throwable occurs while generating the DRD (decision requirements diagram) PNG during DMN deployment. The deployment itself succeeds and the decision remains executable; only the generated diagram resource is not stored in the repository (the method returns null).","triggerScenarios":"Calling the DMN deployer (e.g. RepositoryService.createDeployment().deploy() on a .dmn file, or Spring auto-deployment) when diagram generation throws: headless JVM without fonts/AWT classes, invalid DI (diagram interchange) sections in the DMN XML, or a NullPointerException from missing decision/DI metadata.","commonSituations":"Running in a minimal Docker image without fontconfig/AWT libraries; DMN XML with missing or malformed DMNDI diagram/shape elements; custom classloaders that cannot load icon resources; any JVM where java.awt initialization fails.","solutions":["Install AWT/font support in the runtime environment (e.g. fontconfig + DejaVu fonts in the container) and re-deploy.","Inspect the nested Throwable in the log to fix the actual root cause (e.g. correct the DMNDI section of the .dmn XML).","If diagrams are not needed, ignore the warning safely — deployment and execution are unaffected.","Remove or fix invalid <DMNDI> elements, or regenerate the DMN file with a modeler that emits valid DI."],"exampleFix":"// Dockerfile before (minimal JRE)\nFROM eclipse-temurin:17-jre\n// after (fonts for AWT diagram generation)\nFROM eclipse-temurin:17-jre\nRUN apt-get update && apt-get install -y fontconfig fonts-dejavu-core && rm -rf /var/lib/apt/lists/*","handlingStrategy":"try-catch","validationCode":"try { java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(); } catch (Throwable t) { /* headless/AWT unavailable: expect no diagram */ }","typeGuard":null,"tryCatchPattern":"try { repositoryService.createDeployment().addClasspathResource(\"decision.dmn\").deploy(); } catch (Exception e) { log.error(\"DMN deployment failed\", e); } // diagram loss is only a WARN inside deployment; check resource==null via repository queries","preventionTips":["Install fontconfig/fonts in container images","Validate DMNDI sections of .dmn files before deploying","Treat the warning as cosmetic: verify decisions deploy via repository queries"],"tags":["dmn","deployment","diagram-generation","awt","headless"],"backgroundTag":"resource-not-found","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"}