{"record":{"id":"e060b1a054089818","repo":"flowable/flowable-engine","slug":"e-getmessage-dynamic-message-from-wrapped-excep","errorCode":null,"errorMessage":"e.getMessage() (dynamic message from wrapped exception)","messagePattern":"e\\.getMessage\\(\\) \\(dynamic message from wrapped exception\\)","errorType":"exception","errorClass":"DmnXMLException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-xml-converter/src/main/java/org/flowable/dmn/xml/converter/DmnXMLConverter.java","lineNumber":253,"sourceCode":"        }\n        \n        if (xif.isPropertySupported(XMLConstants.ACCESS_EXTERNAL_SCHEMA)) {\n            xif.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, \"\");\n        }\n\n        if (validateSchema) {\n            try (InputStreamReader in = new InputStreamReader(inputStreamProvider.getInputStream(), encoding)) {\n                if (!enableSafeDmnXml) {\n                    validateModel(inputStreamProvider);\n                } else {\n                    validateModel(xif.createXMLStreamReader(in));\n                }\n            } catch (UnsupportedEncodingException e) {\n                throw new DmnXMLException(\"The dmn xml is not properly encoded\", e);\n            } catch (XMLStreamException e) {\n                throw new DmnXMLException(\"Error while reading the dmn xml file\", e);\n            } catch (Exception e) {\n                throw new DmnXMLException(e.getMessage(), e);\n            }\n        }\n        // The input stream is closed after schema validation\n        try (InputStreamReader in = new InputStreamReader(inputStreamProvider.getInputStream(), encoding)) {\n            // XML conversion\n            return convertToDmnModel(xif.createXMLStreamReader(in));\n        } catch (UnsupportedEncodingException e) {\n            throw new DmnXMLException(\"The dmn xml is not properly encoded\", e);\n        } catch (XMLStreamException e) {\n            throw new DmnXMLException(\"Error while reading the dmn xml file\", e);\n        } catch (IOException e) {\n            throw new DmnXMLException(e.getMessage(), e);\n        }\n    }\n\n    public DmnDefinition convertToDmnModel(XMLStreamReader xtr) {\n        DmnDefinition model = new DmnDefinition();\n        DmnElement parentElement = null;","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-xml-converter/src/main/java/org/flowable/dmn/xml/converter/DmnXMLConverter.java#L235-L271","documentation":"The final catch-all of the validation block wraps any other Exception (SAXException from schema validation, IOException, etc.) into DmnXMLException(e.getMessage(), e). The message is therefore dynamic — it carries the underlying exception's message, e.g. the specific XSD validation error.","triggerScenarios":"validateSchema=true and validation throws a non-XMLStream/non-encoding exception: most commonly SAXParseException because the DMN does not conform to its version's XSD (invalid elements, wrong attribute, bad structure).","commonSituations":"Hand-written DMN XML not matching the DMN 1.1/1.2/1.3 schema; exporting a decision table with modeler bugs; namespace mismatches causing fallback to the DMN 1.1 XSD; missing required child elements like decision tables/hit policies.","solutions":["Read e.getMessage()/cause — it names the exact XSD constraint violated","Validate the file offline against the matching DMN XSD (org/flowable/dmn/xml/...)","Ensure the root element's namespace matches the intended DMN version (1.3/1.2/1.1)","Fix the offending element/attribute indicated by the SAXParseException message"],"exampleFix":"// before\n<definitions xmlns=\"http://www.omg.org/spec/DMN/20151101/dmn/Y\" ...>  <!-- unknown ns -> 1.1 xsd -->\n// after\n<definitions xmlns=\"http://www.omg.org/spec/DMN/20191111/model/dmn/1.2\" ...>  <!-- matches DMN 1.2 xsd -->","handlingStrategy":"validation","validationCode":"SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);\nSchema s = sf.newSchema(new StreamSource(getClass().getResourceAsStream(\"/org/flowable/dmn/xml/DMN13.xsd\")));\ns.newValidator().validate(new StreamSource(new File(\"decision.dmn.xml\"))); // offline pre-check","typeGuard":null,"tryCatchPattern":"try { converter.convertToDmnModel(provider, true, true); } catch (DmnXMLException e) { log.error(\"DMN schema violation: {}\", e.getMessage()); } // message comes from SAXParseException","preventionTips":["Validate DMN files in CI against the official DMN XSD for your version","Keep the definitions targetNamespace consistent with the intended DMN version","Avoid hand-editing DMN XML exported from modelers"],"tags":["xml","xsd","validation","dmn"],"backgroundTag":"schema-validation-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"}