{"record":{"id":"bdac5040563aa32f","repo":"flowable/flowable-engine","slug":"dmn-xsd-could-not-be-found","errorCode":null,"errorMessage":"DMN XSD could not be found","messagePattern":"DMN XSD could not be found","errorType":"exception","errorClass":"DmnXMLException","httpStatus":null,"severity":"error","filePath":"modules/flowable-dmn-xml-converter/src/main/java/org/flowable/dmn/xml/converter/DmnXMLConverter.java","lineNumber":209,"sourceCode":"            throw new DmnXMLException(\"Error processing DMN document\", e);\n        }\n\n        return targetNameSpace;\n    }\n\n    protected Schema createSchema(String xsd) throws SAXException {\n        SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);\n        Schema schema = null;\n        if (classloader != null) {\n            schema = factory.newSchema(classloader.getResource(xsd));\n        }\n\n        if (schema == null) {\n            schema = factory.newSchema(this.getClass().getClassLoader().getResource(xsd));\n        }\n\n        if (schema == null) {\n            throw new DmnXMLException(\"DMN XSD could not be found\");\n        }\n        return schema;\n    }\n\n    public DmnDefinition convertToDmnModel(InputStreamProvider inputStreamProvider, boolean validateSchema, boolean enableSafeDmnXml) {\n        return convertToDmnModel(inputStreamProvider, validateSchema, enableSafeDmnXml, DEFAULT_ENCODING);\n    }\n\n    public DmnDefinition convertToDmnModel(InputStreamProvider inputStreamProvider, boolean validateSchema, boolean enableSafeDmnXml, String encoding) {\n        XMLInputFactory xif = XMLInputFactory.newInstance();\n\n        if (xif.isPropertySupported(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES)) {\n            xif.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, false);\n        }\n\n        if (xif.isPropertySupported(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES)) {\n            xif.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);\n        }","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-xml-converter/src/main/java/org/flowable/dmn/xml/converter/DmnXMLConverter.java#L191-L227","documentation":"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\".","triggerScenarios":"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.","commonSituations":"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.","solutions":["Remove the custom classloader or make it delegate to the parent/converters resources","Verify the flowable-dmn-xml-converter jar contains the DMN XSD files (unzip -l)","Fix maven-shade/assembly filters so *.xsd resources are not excluded","Rebuild dependencies to restore a clean flowable jar"],"exampleFix":"// before\ndmnXmlConverter.setClassloader(customUrlClassLoaderWithoutXsd);\n// after\n// drop the override, or use a classloader that delegates:\ndmnXmlConverter.setClassloader(DmnXMLConverter.class.getClassLoader());","handlingStrategy":"validation","validationCode":"String xsd = \"org/flowable/dmn/xml/DMN13.xsd\"; // whichever the converter picks\nif (getClass().getClassLoader().getResource(xsd) == null) throw new IllegalStateException(\"DMN XSD missing from classpath: \" + xsd);","typeGuard":null,"tryCatchPattern":"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\"); } }","preventionTips":["Ensure maven-shade/assembly does not filter *.xsd resources","Only set a custom classloader if it can load converter resources (delegation to parent)","Verify flowable-dmn-xml-converter jar contents after dependency changes"],"tags":["classpath","xsd","schema","resources"],"backgroundTag":"resource-not-found","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}