flowable/flowable-engine · error · FlowableException
Error parsing XML
Error message
Error parsing XML
What it means
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.
Source
Thrown at modules/flowable-cmmn-engine/src/main/java/org/flowable/cmmn/engine/impl/parser/CmmnParserImpl.java:75
CmmnModel cmmnModel = convertToCmmnModel(context, cmmnSource);
cmmnParseResult.setCmmnModel(cmmnModel);
if (context.validateCmmnModel()) {
validateCmmnModel(context.caseValidator(), cmmnModel);
}
processCmmnElements(cmmnModel, cmmnParseResult);
return cmmnParseResult;
} catch (Exception e) {
if (e instanceof FlowableException) {
throw (FlowableException) e;
} else if (e instanceof CmmnXMLException) {
throw (CmmnXMLException) e;
} else {
throw new FlowableException("Error parsing XML", e);
}
}
}
protected CmmnModel convertToCmmnModel(CmmnParseContext context, StreamSource cmmnSource) {
boolean enableSafeBpmnXml = context.enableSafeXml();
String encoding = context.xmlEncoding();
boolean validateCmmnXml = context.validateXml();
return new CmmnXmlConverter().convertToCmmnModel(cmmnSource, validateCmmnXml, enableSafeBpmnXml, encoding);
}
protected void validateCmmnModel(CaseValidator caseValidator, CmmnModel cmmnModel) {
if (caseValidator == null) {
logger.warn("Case should be validated, but no case validator is configured on the case engine configuration!");
} else {
List<ValidationEntry> validationEntries = caseValidator.validate(cmmnModel);
if (validationEntries != null && !validationEntries.isEmpty()) {View on GitHub (pinned to d6d39ce1c6)
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.
Example fix
// before <case id="c1"> <stage id="s1"> </stage></case> <!-- mismatched/invalid markup --> // after <case id="c1" xmlns="http://www.omg.org/spec/CMMN/20151109/MODEL"> ... well-formed ... </case>
Defensive patterns
Strategy: try-catch
Validate before calling
DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(cmmnXml)); // well-formedness pre-check
Try / catch
try { parser.parse(context, source); } catch (FlowableException e) { log("CMMN XML parse failed", e.getCause()); throw e; } Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- Error while reading the CMMN 1.1 XML
- Error converting condition
- Error converting decision reference expression
- Error parsing XML
- Error processing CMMN document
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/5f6df5af8be64bfe.
Report an issue: GitHub.