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

  1. Rename the file to a supported extension before upload, e.g. mv model.xml model.cmmn.xml (only if it really is CMMN XML).
  2. If deploying a BPMN process, use the BPMN REST deployments endpoint instead of the CMMN one.
  3. If deploying a bundle, package resources into a .bar or .zip archive and upload that.
  4. 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

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


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/237586e74279f997. Report an issue: GitHub.