flowable/flowable-engine · error · FlowableIllegalArgumentException
File must be of type .cmmn.xml, .cmmn, .bar or .zip
Error message
File must be of type .cmmn.xml, .cmmn, .bar or .zip
What it means
The uploaded file's name/extension must be one of the supported CMMN deployment artifact types: .cmmn.xml, .cmmn, .bar or .zip. Anything else (e.g. .xml alone, .txt, .cmmn10) is rejected with FlowableIllegalArgumentException because the endpoint cannot decide how to load the resource.
Source
Thrown at modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/DeploymentCollectionResource.java:210
.toLowerCase().endsWith(".zip"))) {
fileName = file.getName();
}
if (fileName.endsWith(".cmmn.xml") || fileName.endsWith(".cmmn")) {
try (final InputStream fileInputStream = file.getInputStream()) {
deploymentBuilder.addInputStream(fileName, fileInputStream);
}
} else if (fileName.toLowerCase().endsWith(".bar") || fileName.toLowerCase().endsWith(".zip")) {
try (InputStream fileInputStream = file.getInputStream();
ZipInputStream zipInputStream = new ZipInputStream(fileInputStream)) {
deploymentBuilder.addZipInputStream(zipInputStream);
}
} else {
throw new FlowableIllegalArgumentException("File must be of type .cmmn.xml, .cmmn, .bar or .zip");
}
if (!decodedQueryStrings.containsKey("deploymentName") || StringUtils.isEmpty(decodedQueryStrings.get("deploymentName"))) {
String fileNameWithoutExtension = fileName.split("\\.")[0];
if (StringUtils.isNotEmpty(fileNameWithoutExtension)) {
fileName = fileNameWithoutExtension;
}
deploymentBuilder.name(fileName);
} else {
deploymentBuilder.name(decodedQueryStrings.get("deploymentName"));
}
if (decodedQueryStrings.containsKey("deploymentKey") || StringUtils.isNotEmpty(decodedQueryStrings.get("deploymentKey"))) {
deploymentBuilder.key(decodedQueryStrings.get("deploymentKey"));
}View on GitHub (pinned to d6d39ce1c6)
Solutions
- Rename the file to a supported extension before upload, e.g. mv model.xml model.cmmn.xml (only if it really is CMMN XML).
- If deploying a BPMN process, use the BPMN REST deployments endpoint instead of the CMMN one.
- If deploying a bundle, package resources into a .bar or .zip archive and upload that.
- Verify the filename survives the client-side serialization (some libraries strip paths/extensions).
Example fix
// before curl -F 'file=@case.xml' .../cmmn-query/repository/deployments // after curl -F 'file=@case.cmmn.xml' .../cmmn-query/repository/deployments
Defensive patterns
Strategy: validation
Validate before calling
const ok = /\.(cmmn\.xml|cmmn|bar|zip)$/i;
if (!ok.test(fileName)) throw new Error(`Unsupported deployment file: ${fileName}`); Prevention
- Keep CMMN artifacts with canonical double extensions (.cmmn.xml).
- Rename BPMN files out of CMMN upload pipelines — use the BPMN endpoint.
- Bundle multi-resource deployments as .bar/.zip.
When it happens
Trigger: uploadDeployment receives a file part whose filename does not end in .cmmn.xml, .cmmn, .bar or .zip — e.g. uploading plainProcess.xml, model.bpmn20.xml (BPMN, not CMMN), or a misnamed archive.
Common situations: Uploading a BPMN file to the CMMN endpoint, renaming a .zip to .zippart during partial transfer, stripped double extensions (.cmmn.xml saved as .xml), or case-sensitivity issues like .CMMN on strict filename checks.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- Multipart request with file content is required
- Could not find a case instance with id '${caseInstanceId}'.
- Historic task instance '' variable value for couldn't be fo
- Historic variable instance '' couldn't be found.
- Variable operation is missing for variable:
AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11).
Data as JSON: /api/errors/237586e74279f997.
Report an issue: GitHub.