flowable/flowable-engine · error · CmmnXMLException

CMND XSD could not be found

Error message

CMND XSD could not be found

What it means

When converting a CmmnModel back to XML, the converter lazily loads the CMMN 1.1 XSD from the classpath to build a javax.xml.validation.Schema. If the resource at XSD_LOCATION is missing from the classpath, this CmmnXMLException is thrown, meaning the Flowable cmmn-converter artifact or its schema resource is not on the runtime classpath.

Source

Thrown at modules/flowable-cmmn-converter/src/main/java/org/flowable/cmmn/converter/CmmnXmlConverter.java:276

        Schema schema = createSchema();

        Validator validator = schema.newValidator();
        validator.validate(new StAXSource(xmlStreamReader));
    }

    protected Schema createSchema() throws SAXException {
        SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        Schema schema = null;
        if (classloader != null) {
            schema = factory.newSchema(classloader.getResource(XSD_LOCATION));
        }

        if (schema == null) {
            schema = factory.newSchema(this.getClass().getClassLoader().getResource(XSD_LOCATION));
        }

        if (schema == null) {
            throw new CmmnXMLException("CMND XSD could not be found");
        }
        return schema;
    }

    public byte[] convertToXML(CmmnModel model) {
        return convertToXML(model, DEFAULT_ENCODING);
    }

    public byte[] convertToXML(CmmnModel model, String encoding) {
        try {

            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

            XMLOutputFactory xof = XMLOutputFactory.newInstance();
            OutputStreamWriter out = new OutputStreamWriter(outputStream, encoding);

            XMLStreamWriter writer = xof.createXMLStreamWriter(out);
            XMLStreamWriter xtw = new IndentingXMLStreamWriter(writer);

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Ensure the full flowable-cmmn-converter dependency (including XSD resources) is packaged — check jar contents for the XSD
  2. Fix maven-shade/assembly filters to stop excluding *.xsd
  3. Verify the classloader used can load resources from the converter jar
  4. Rebuild the deployment archive completely rather than patching files

Example fix

// before (maven-shade)
<filter><exclude>*:*</exclude><excludes><exclude>*.xsd</exclude></excludes></filter>
// after
<!-- remove the *.xsd exclusion so the CMMN 1.1 schema ships in the jar -->
Defensive patterns

Strategy: validation

Validate before calling

String xsdPath = "org/flowable/cmmn/schema/CMMN11.xsd"; // matches converter XSD_LOCATION
if (getClass().getClassLoader().getResource(xsdPath) == null)
    throw new IllegalStateException("CMMN 1.1 XSD missing from classpath: " + xsdPath);

Try / catch

try {
    byte[] xml = converter.convertToXML(model);
} catch (CmmnXMLException e) {
    if (e.getMessage().contains("XSD could not be found"))
        throw new IllegalStateException("flowable-cmmn-converter resources missing from classpath", e);
    throw e;
}

Prevention

When it happens

Trigger: Calling convertToXML(model) (which validates against the schema) in an environment where the CMMN 1.1 XSD resource was excluded by build filtering/shading, or running with a repackaged jar that dropped resources.

Common situations: Shaded/fat-jar builds excluding .xsd resources, custom classloading that cannot see resources from the flowable-cmmn-converter jar, or partially extracted deployment archives.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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