{"record":{"id":"be46ce5af380a1d7","repo":"flowable/flowable-engine","slug":"could-not-load-image-for-decision-requirements-dia","errorCode":null,"errorMessage":"Could not load image for decision requirements diagram creation: {}","messagePattern":"Could not load image for decision requirements diagram creation: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable-dmn-image-generator/src/main/java/org/flowable/dmn/image/impl/DefaultDecisionRequirementsDiagramCanvas.java","lineNumber":183,"sourceCode":"        if (!\"png\".equalsIgnoreCase(imageType)) {\n            this.g.setBackground(new Color(255, 255, 255, 0));\n            this.g.clearRect(0, 0, canvasWidth, canvasHeight);\n        }\n\n        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n        g.setPaint(Color.black);\n\n        Font font = new Font(activityFontName, Font.BOLD, FONT_SIZE);\n        g.setFont(font);\n        this.fontMetrics = g.getFontMetrics();\n\n        LABEL_FONT = new Font(labelFontName, Font.ITALIC, 10);\n        ANNOTATION_FONT = new Font(annotationFontName, Font.PLAIN, FONT_SIZE);\n\n        try {\n         DECISION_IMAGE = ImageIO.read(ReflectUtil.getResource(\"org/flowable/icons/decision.png\", customClassLoader));\n        } catch (IOException e) {\n            LOGGER.warn(\"Could not load image for decision requirements diagram creation: {}\", e.getMessage());\n        }\n    }\n\n    /**\n     * Generates an image of what currently is drawn on the canvas.\n     *\n     * Throws an {@link FlowableImageException} when {@link #close()} is already called.\n     */\n    public InputStream generateImage(String imageType) {\n        if (closed) {\n            throw new FlowableImageException(\"CaseDiagramGenerator already closed\");\n        }\n\n        try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {\n            ImageIO.write(decisionRequirementsDiagram, imageType, out);\n            return new ByteArrayInputStream(out.toByteArray());\n        } catch (IOException e) {\n            throw new FlowableImageException(\"Error while generating case image\", e);","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-image-generator/src/main/java/org/flowable/dmn/image/impl/DefaultDecisionRequirementsDiagramCanvas.java#L165-L201","documentation":"A WARN from DefaultDecisionRequirementsDiagramCanvas.initialize: the built-in icon resource org/flowable/icons/decision.png could not be read via ImageIO (IOException). The DECISION_IMAGE field stays null, which can later cause NullPointerExceptions or degraded rendering when the DRD image is generated.","triggerScenarios":"Constructing DefaultDecisionRequirementsDiagramCanvas (during DRD generation on DMN deployment) when the flowable-dmn-image-generator jar is corrupted/incomplete or the custom classloader cannot resolve the icon resource.","commonSituations":"Uber/fat-jar packaging or shading that drops resources; classloader restrictions in application servers/OSGi; partially downloaded dependency in a local Maven repository; running under a classloader that hides org.flowable resources.","solutions":["Verify the flowable-dmn-image-generator jar contains org/flowable/icons/decision.png (jar tf ...) and re-download/refresh the dependency if missing.","Avoid shading/excluding Flowable resource files in maven-shade/minimizeJar configuration.","Check the custom classloader passed to the canvas can see Flowable classpath resources.","Install AWT/ImageIO dependencies if the IOException stems from missing image codec support."],"exampleFix":"// before (shade config)\n<minimizeJar>true</minimizeJar>\n// after\n<minimizeJar>false</minimizeJar>\n<!-- or add filter keeping org/flowable/icons/** -->","handlingStrategy":"fallback","validationCode":"boolean iconPresent = getClass().getClassLoader().getResource(\"org/flowable/icons/decision.png\") != null;","typeGuard":null,"tryCatchPattern":"try { new DefaultDecisionRequirementsDiagramGenerator().generateDiagram(...); } catch (Throwable t) { log.warn(\"Skipping diagram generation: {}\", t.getMessage()); }","preventionTips":["Do not exclude resources when shading Flowable jars","Verify jar integrity after dependency downloads (mvn verify)","Test diagram generation in CI with a minimal deployment"],"tags":["dmn","image-generator","classpath","resource-loading"],"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"}