{"record":{"id":"51adf90d70c4068f","repo":"flowable/flowable-engine","slug":"the-cmmn-1-1-xml-is-not-properly-encoded","errorCode":null,"errorMessage":"The CMMN 1.1 xml is not properly encoded","messagePattern":"The CMMN 1\\.1 xml is not properly encoded","errorType":"exception","errorClass":"CmmnXMLException","httpStatus":null,"severity":"error","filePath":"modules/flowable-cmmn-converter/src/main/java/org/flowable/cmmn/converter/CmmnXmlConverter.java","lineNumber":187,"sourceCode":"            xif.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, \"\");\n        }\n        if (xif.isPropertySupported(XMLConstants.ACCESS_EXTERNAL_SCHEMA)) {\n            xif.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, \"\");\n        }\n\n        if (encoding == null) {\n            encoding = DEFAULT_ENCODING;\n        }\n\n        if (validateSchema) {\n            try (InputStreamReader in = new InputStreamReader(inputStreamProvider.getInputStream(), encoding)) {\n                if (!enableSafeBpmnXml) {\n                    validateModel(inputStreamProvider);\n                } else {\n                    validateModel(new FlowableXMLStreamReader(xif.createXMLStreamReader(in)));\n                }\n            } catch (UnsupportedEncodingException e) {\n                throw new CmmnXMLException(\"The CMMN 1.1 xml is not properly encoded\", e);\n            } catch (XMLStreamException e) {\n                throw new CmmnXMLException(\"Error while reading the CMMN 1.1 XML\", e);\n            } catch (Exception e) {\n                throw new CmmnXMLException(e.getMessage(), e);\n            }\n        }\n        // The input stream is closed after schema validation\n        try (InputStreamReader in = new InputStreamReader(inputStreamProvider.getInputStream(), encoding)) {\n            // XML conversion\n            return convertToCmmnModel(xif.createXMLStreamReader(in));\n        } catch (UnsupportedEncodingException e) {\n            throw new CmmnXMLException(\"The CMMN 1.1 xml is not properly encoded\", e);\n        } catch (XMLStreamException e) {\n            throw new CmmnXMLException(\"Error while reading the CMMN 1.1 XML\", e);\n        } catch (IOException e) {\n            throw new CmmnXMLException(e.getMessage(), e);\n        }\n    }","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-cmmn-converter/src/main/java/org/flowable/cmmn/converter/CmmnXmlConverter.java#L169-L205","documentation":"CmmnXmlConverter.convertToCmmnModel opens the source stream with the given encoding to run schema validation. If the JVM cannot support that encoding (UnsupportedEncodingException), it throws CmmnXMLException 'The CMMN 1.1 xml is not properly encoded'.","triggerScenarios":"Calling CmmnXmlConverter.convertToCmmnModel with an encoding string unsupported by the JVM (e.g. a typo'd charset name on the configured encoding) while creating the InputStreamReader/XMLStreamReader for validation.","commonSituations":"Setting an invalid encoding on the converter or deployment; moving apps to a JVM with a reduced charset set; passing encoding from config with typos like 'utf-8 ' or 'UTF8-' variants unsupported.","solutions":["Use a standard charset such as 'UTF-8' for the CMMN XML and converter encoding","Validate the encoding string with Charset.isSupported(...) before conversion","Re-encode the XML file to UTF-8","Check the wrapped UnsupportedEncodingException cause for the offending charset name"],"exampleFix":"// before\nconverter.setEncoding(\"UTF-8-Strict\");\n// after\nconverter.setEncoding(\"UTF-8\");","handlingStrategy":"validation","validationCode":"String enc = converterEncoding; // e.g. from config\nif (!Charset.isSupported(enc)) throw new IllegalArgumentException(\"Unsupported encoding for CMMN XML: \" + enc);","typeGuard":null,"tryCatchPattern":"try { converter.convertToCmmnModel(provider); } catch (CmmnXMLException e) { throw new IllegalArgumentException(\"Bad encoding for CMMN XML: \" + e.getCause().getMessage(), e); }","preventionTips":["Standardize on UTF-8 for all CMMN resources","Validate encoding strings from configuration with Charset.isSupported","Re-encode legacy files to UTF-8 before deployment"],"tags":["cmmn","xml","encoding","conversion"],"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-14T05:17:10.506Z"}