{"record":{"id":"57d574dcc5c98ada","repo":"flowable/flowable-engine","slug":"error-parsing-xml-57d574","errorCode":null,"errorMessage":"Error parsing XML","messagePattern":"Error parsing XML","errorType":"validation","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/parser/BpmnParse.java","lineNumber":206,"sourceCode":"\n            bpmnModel.setSourceSystemId(sourceSystemId);\n            bpmnModel.setEventSupport(new FlowableEventSupport());\n\n            // Validation successful (or no validation)\n\n            // Attach logic to the processes (eg. map ActivityBehaviors to bpmn model elements)\n            applyParseHandlers();\n\n            // Finally, process the diagram interchange info\n            processDI();\n\n        } catch (Exception e) {\n            if (e instanceof FlowableException) {\n                throw (FlowableException) e;\n            } else if (e instanceof XMLException) {\n                throw (XMLException) e;\n            } else {\n                throw new FlowableException(\"Error parsing XML\", e);\n            }\n        }\n\n        return this;\n    }\n\n    public BpmnParse name(String name) {\n        this.name = name;\n        return this;\n    }\n\n    public BpmnParse sourceInputStream(InputStream inputStream) {\n        if (name == null) {\n            name(\"inputStream\");\n        }\n        setStreamSource(new InputStreamSource(inputStream));\n        return this;\n    }","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine/src/main/java/org/flowable/engine/impl/bpmn/parser/BpmnParse.java#L188-L224","documentation":"BpmnParse.execute() wraps the whole parse in a try/catch: unexpected exceptions that are neither FlowableException nor XMLException are rethrown as FlowableException(\"Error parsing XML\", e) preserving the cause. It signals a generic, non-classified failure while parsing the BPMN model.","triggerScenarios":"Any unexpected exception during parsing — e.g. SAX/parser factory configuration errors, IOException reading the stream source, NPEs in custom parse handlers, or a missing/unsupported XML feature in the JDK's XML parser.","commonSituations":"Corrupt or non-XML file deployed as BPMN resource; incompatible parser features (XXE protection settings); custom parser hooks throwing runtime exceptions; encoding issues in the XML stream.","solutions":["Inspect the wrapped cause (getCause()) — the real failure is there, not the message","Verify the deployed resource is well-formed XML with correct encoding","Try parsing the file with a plain XML parser to isolate malformed content","Check JVM XML parser configuration (secure processing / feature flags) if the cause is a SAXException"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// ensure well-formed XML before deploying\njavax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File(\"process.bpmn20.xml\"));","typeGuard":null,"tryCatchPattern":"try {\n    deploymentBuilder.deploy();\n} catch (FlowableException e) {\n    if (\"Error parsing XML\".equals(e.getMessage())) {\n        Throwable cause = e.getCause();\n        log.error(\"XML parse failed: {}\", cause, cause);\n    }\n}","preventionTips":["Inspect getCause() — the real error is always wrapped","Ensure resources are UTF-8/valid XML before deployment","Check JVM SAX parser security features when causes are SAXException"],"tags":["bpmn","parsing","xml"],"backgroundTag":"json-parse-error","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"}