{"record":{"id":"237586e74279f997","repo":"flowable/flowable-engine","slug":"file-must-be-of-type-cmmn-xml-cmmn-bar-or-zi","errorCode":null,"errorMessage":"File must be of type .cmmn.xml, .cmmn, .bar or .zip","messagePattern":"File must be of type \\.cmmn\\.xml, \\.cmmn, \\.bar or \\.zip","errorType":"http","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/DeploymentCollectionResource.java","lineNumber":210,"sourceCode":"                    .toLowerCase().endsWith(\".zip\"))) {\n\n                fileName = file.getName();\n            }\n\n            if (fileName.endsWith(\".cmmn.xml\") || fileName.endsWith(\".cmmn\")) {\n                try (final InputStream fileInputStream = file.getInputStream()) {\n                    deploymentBuilder.addInputStream(fileName, fileInputStream);\n                }\n                \n            } else if (fileName.toLowerCase().endsWith(\".bar\") || fileName.toLowerCase().endsWith(\".zip\")) {\n                try (InputStream fileInputStream = file.getInputStream();\n                        ZipInputStream zipInputStream = new ZipInputStream(fileInputStream)) {\n                    \n                    deploymentBuilder.addZipInputStream(zipInputStream);\n                }\n                \n            } else {\n                throw new FlowableIllegalArgumentException(\"File must be of type .cmmn.xml, .cmmn, .bar or .zip\");\n            }\n\n            if (!decodedQueryStrings.containsKey(\"deploymentName\") || StringUtils.isEmpty(decodedQueryStrings.get(\"deploymentName\"))) {\n                String fileNameWithoutExtension = fileName.split(\"\\\\.\")[0];\n\n                if (StringUtils.isNotEmpty(fileNameWithoutExtension)) {\n                    fileName = fileNameWithoutExtension;\n                }\n\n                deploymentBuilder.name(fileName);\n                \n            } else {\n                deploymentBuilder.name(decodedQueryStrings.get(\"deploymentName\"));\n            }\n\n            if (decodedQueryStrings.containsKey(\"deploymentKey\") || StringUtils.isNotEmpty(decodedQueryStrings.get(\"deploymentKey\"))) {\n                deploymentBuilder.key(decodedQueryStrings.get(\"deploymentKey\"));\n            }","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-rest/src/main/java/org/flowable/cmmn/rest/service/api/repository/DeploymentCollectionResource.java#L192-L228","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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)."],"exampleFix":"// before\ncurl -F 'file=@case.xml' .../cmmn-query/repository/deployments\n\n// after\ncurl -F 'file=@case.cmmn.xml' .../cmmn-query/repository/deployments","handlingStrategy":"validation","validationCode":"const ok = /\\.(cmmn\\.xml|cmmn|bar|zip)$/i;\nif (!ok.test(fileName)) throw new Error(`Unsupported deployment file: ${fileName}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["rest-api","file-upload","file-extension","flowable"],"backgroundTag":"invalid-argument-value","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"}