flowable/flowable-engine · error · DmnXMLException

Error processing DMN document

Error message

Error processing DMN document

What it means

DmnXMLConverter.getTargetNameSpace(InputStream) creates an XMLStreamReader over the DMN document to detect the DMN version namespace. If the underlying stream cannot be parsed (malformed XML, premature EOF), the XMLStreamException is wrapped as DmnXMLException "Error processing DMN document".

Solutions

  1. Validate the DMN file is well-formed XML in an editor/xmllint before deploying
  2. Check the file is complete and not truncated (compare size/hash with source)
  3. Ensure the file starts with a valid XML declaration and root element
  4. Regenerate or re-export the DMN file from the DMN modeling tool

Example fix

// before
cat broken.dmn.xml | head -c 50  // truncated output
// after
xmllint --noout decision.dmn.xml  // confirms well-formedness before deploy
Defensive patterns

Strategy: validation

Validate before calling

try { XMLInputFactory.newInstance().createXMLStreamReader(new FileInputStream(f)).close(); } catch (XMLStreamException e) { throw new IllegalStateException("Not well-formed XML: " + f, e); }

Try / catch

try { converter.convertToDmnModel(provider, true, false); } catch (DmnXMLException e) { log.error("DMN parse failed", e.getCause()); }

Prevention

When it happens

Trigger: Calling DmnXMLConverter.convertToDmnModel with schema validation enabled on an InputStream whose XML cannot be read/parsed during namespace detection: corrupt file, empty file, truncated XML, invalid prolog.

Common situations: Corrupted DMN files committed to resources; truncated uploads; files that are actually HTML error pages or wrong format saved with .dmn.xml extension; encoding issues breaking the XML prolog.

Related errors


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

Appendix: source

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

            schema = createSchema(DMN_XSD);
        } else if (DMN_12_TARGET_NAMESPACE.equals(targetNameSpace)) {
            schema = createSchema(DMN_12_XSD);
        } else {
            schema = createSchema(DMN_11_XSD);
        }
        Validator validator = schema.newValidator();
        validator.validate(new StAXSource(xmlStreamReader));
    }

    protected String getTargetNameSpace(InputStream is) {
        try {
            XMLInputFactory xif = XMLInputFactory.newInstance();
            XMLStreamReader xtr = xif.createXMLStreamReader(is);

            return getTargetNameSpace(xtr);
        } catch (XMLStreamException e) {
            LOGGER.error("Error processing DMN document", e);
            throw new DmnXMLException("Error processing DMN document", e);
        }
    }

    protected String getTargetNameSpace(XMLStreamReader xmlStreamReader) {
        String targetNameSpace = null;
        try {
            while (xmlStreamReader.hasNext()) {
                try {
                    xmlStreamReader.next();
                } catch (Exception e) {
                    LOGGER.debug("Error reading XML document", e);
                    throw new DmnXMLException("Error reading XML", e);
                }
                targetNameSpace = xmlStreamReader.getNamespaceURI();
                break;
            }
        } catch (XMLStreamException e) {
            LOGGER.error("Error processing DMN document", e);

View on GitHub (pinned to d6d39ce1c6)