{"record":{"id":"5f6df5af8be64bfe","repo":"flowable/flowable-engine","slug":"error-parsing-xml","errorCode":null,"errorMessage":"Error parsing XML","messagePattern":"Error parsing XML","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/parser/CmmnParserImpl.java","lineNumber":75,"sourceCode":"\n            CmmnModel cmmnModel = convertToCmmnModel(context, cmmnSource);\n            cmmnParseResult.setCmmnModel(cmmnModel);\n\n            if (context.validateCmmnModel()) {\n                validateCmmnModel(context.caseValidator(), cmmnModel);\n            }\n\n            processCmmnElements(cmmnModel, cmmnParseResult);\n\n            return cmmnParseResult;\n\n        } catch (Exception e) {\n            if (e instanceof FlowableException) {\n                throw (FlowableException) e;\n            } else if (e instanceof CmmnXMLException) {\n                throw (CmmnXMLException) e;\n            } else {\n                throw new FlowableException(\"Error parsing XML\", e);\n            }\n        }\n    }\n\n    protected CmmnModel convertToCmmnModel(CmmnParseContext context, StreamSource cmmnSource) {\n        boolean enableSafeBpmnXml = context.enableSafeXml();\n        String encoding = context.xmlEncoding();\n        boolean validateCmmnXml = context.validateXml();\n\n        return new CmmnXmlConverter().convertToCmmnModel(cmmnSource, validateCmmnXml, enableSafeBpmnXml, encoding);\n    }\n\n    protected void validateCmmnModel(CaseValidator caseValidator, CmmnModel cmmnModel) {\n        if (caseValidator == null) {\n            logger.warn(\"Case should be validated, but no case validator is configured on the case engine configuration!\");\n        } else {\n            List<ValidationEntry> validationEntries = caseValidator.validate(cmmnModel);\n            if (validationEntries != null && !validationEntries.isEmpty()) {","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/parser/CmmnParserImpl.java#L57-L93","documentation":"CmmnParserImpl.parse catches any exception during CMMN XML parsing/conversion/validation. FlowableException and CmmnXMLException are rethrown as-is; anything else is wrapped in this generic FlowableException(\"Error parsing XML\", e) so callers get a consistent exception type with the original as cause.","triggerScenarios":"Parsing a .cmmn/.cmmn.xml resource whose XML is malformed, whose schema content triggers a non-Flowable runtime exception (e.g. NPE in a converter), or with SAX/stax issues during convertToCmmnModel.","commonSituations":"Broken XML in a case definition deployed via repository service; XML not well-formed after templating; resource read truncation; unexpected runtime error in parsing handlers.","solutions":["Inspect the cause chain for the underlying SAX/Jackson/runtime error with the real location.","Validate the .cmmn XML against the CMMN 1.1 XSD and ensure it is well-formed before deployment.","Fix XML special characters/encoding issues (unescaped &, wrong encoding declarations).","If a specific element triggers it, check element attributes/extensions against supported Flowable CMMN constructs."],"exampleFix":"// before\n<case id=\"c1\"> <stage id=\"s1\"> </stage></case> <!-- mismatched/invalid markup -->\n// after\n<case id=\"c1\" xmlns=\"http://www.omg.org/spec/CMMN/20151109/MODEL\"> ... well-formed ... </case>","handlingStrategy":"try-catch","validationCode":"DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(cmmnXml)); // well-formedness pre-check","typeGuard":null,"tryCatchPattern":"try { parser.parse(context, source); } catch (FlowableException e) { log(\"CMMN XML parse failed\", e.getCause()); throw e; }","preventionTips":["Validate .cmmn files against the CMMN 1.1 XSD before deployment.","Run an XML well-formedness check in CI for all case resources.","Escape XML special characters in templated definitions.","Fix encodings/declaration issues in generated XML."],"tags":["cmmn","xml","parsing","deployment"],"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-14T11:17:12.474Z"}