flowable/flowable-engine · error · DmnXMLException

DMN XSD could not be found

Error message

DMN XSD could not be found

What it means

createSchema loads the DMN XSD (1.1/1.2/1.3, chosen by target namespace) from the classpath to build a javax.xml.validation.Schema. If neither the custom classloader nor the converter's classloader can resolve the XSD resource, the code deliberately throws DmnXMLException "DMN XSD could not be found".

Solutions

  1. Remove the custom classloader or make it delegate to the parent/converters resources
  2. Verify the flowable-dmn-xml-converter jar contains the DMN XSD files (unzip -l)
  3. Fix maven-shade/assembly filters so *.xsd resources are not excluded
  4. Rebuild dependencies to restore a clean flowable jar

Example fix

// before
dmnXmlConverter.setClassloader(customUrlClassLoaderWithoutXsd);
// after
// drop the override, or use a classloader that delegates:
dmnXmlConverter.setClassloader(DmnXMLConverter.class.getClassLoader());
Defensive patterns

Strategy: validation

Validate before calling

String xsd = "org/flowable/dmn/xml/DMN13.xsd"; // whichever the converter picks
if (getClass().getClassLoader().getResource(xsd) == null) throw new IllegalStateException("DMN XSD missing from classpath: " + xsd);

Try / catch

try { converter.convertToDmnModel(provider, true, false); } catch (DmnXMLException e) { if ("DMN XSD could not be found".equals(e.getMessage())) { log.error("XSD resource missing - check packaging"); } }

Prevention

When it happens

Trigger: validateModel is invoked but the XSD resource is absent from the classpath — typically when flowable-dmn-xml-converter jar resources are missing, a shaded/fat jar excluded the .xsd files, or a custom classloader is set that cannot see the XSD.

Common situations: Custom classloader set via setClassloader() that doesn't include converter resources; fat-jar/shading config filtering resource files; corrupted dependency installation; OSGi or app-server classloader isolation.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at modules/flowable-dmn-xml-converter/src/main/java/org/flowable/dmn/xml/converter/DmnXMLConverter.java:209

            throw new DmnXMLException("Error processing DMN document", e);
        }

        return targetNameSpace;
    }

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

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

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

    public DmnDefinition convertToDmnModel(InputStreamProvider inputStreamProvider, boolean validateSchema, boolean enableSafeDmnXml) {
        return convertToDmnModel(inputStreamProvider, validateSchema, enableSafeDmnXml, DEFAULT_ENCODING);
    }

    public DmnDefinition convertToDmnModel(InputStreamProvider inputStreamProvider, boolean validateSchema, boolean enableSafeDmnXml, String encoding) {
        XMLInputFactory xif = XMLInputFactory.newInstance();

        if (xif.isPropertySupported(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES)) {
            xif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, false);
        }

        if (xif.isPropertySupported(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES)) {
            xif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
        }

View on GitHub (pinned to d6d39ce1c6)