{"record":{"id":"ed2335b874e39ded","repo":"flowable/flowable-engine","slug":"could-not-parse-mybatis-configuration-file","errorCode":null,"errorMessage":"Could not parse Mybatis configuration file","messagePattern":"Could not parse Mybatis configuration file","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfigurator.java","lineNumber":155,"sourceCode":"                                                node.getAttributes().getNamedItem(\"handler\").getTextContent());\n                            } catch (Exception e) {\n                                throw new FlowableException(\"Failed to load type handler class\", e);\n                            }\n                        }\n                    };\n                    typeHandlerConfigurators.add(typeHandler);\n                }\n                \n                NodeList nodeList = document.getElementsByTagName(\"mapper\");\n                for (int i = 0; i < nodeList.getLength(); i++) {\n                    Node node = nodeList.item(i);\n                    resources.add(node.getAttributes().getNamedItem(\"resource\").getTextContent());\n                }\n                \n            } catch (IOException e) {\n                throw new FlowableException(\"Could not read IDM Mybatis configuration file\", e);\n            } catch (ParserConfigurationException | SAXException e) {\n                throw new FlowableException(\"Could not parse Mybatis configuration file\", e);\n            }\n            \n            if (typeAliasConfigurators.size() > 0) {\n                if (engineConfiguration.getDependentEngineMybatisTypeAliasConfigs() == null) {\n                    engineConfiguration.setDependentEngineMybatisTypeAliasConfigs(typeAliasConfigurators);\n                    \n                } else {\n                    engineConfiguration.getDependentEngineMybatisTypeAliasConfigs().addAll(typeAliasConfigurators);\n                }\n            }\n            \n            if (typeHandlerConfigurators.size() > 0) {\n                if (engineConfiguration.getDependentEngineMybatisTypeHandlerConfigs() == null) {\n                    engineConfiguration.setDependentEngineMybatisTypeHandlerConfigs(typeHandlerConfigurators);\n                    \n                } else {\n                    engineConfiguration.getDependentEngineMybatisTypeHandlerConfigs().addAll(typeHandlerConfigurators);\n                }","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfigurator.java#L137-L173","documentation":"registerCustomMybatisMappings parses the custom MyBatis XML configuration with a DOM parser. If the document is malformed XML (ParserConfigurationException or SAXException), the engine throws this FlowableException with the parse error as cause.","triggerScenarios":"beforeInit -> registerCustomMybatisMappings: DocumentBuilder fails to parse the custom MyBatis XML due to invalid syntax, unclosed tags, bad encoding, or invalid DTD/schema references.","commonSituations":"Hand-edited custom MyBatis XML with syntax errors, wrong file encoding, truncated/corrupted file in deployment, XML that doesn't follow the expected mapping-config structure.","solutions":["Validate the XML file with an XML parser/linter and fix syntax errors","Check the wrapped cause (SAXParseException) for the exact line/column of the problem","Replace the file with a known-good copy and re-deploy"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"try { DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File(\"mybatis-mappings.xml\")); } catch (SAXException | ParserConfigurationException | IOException e) { throw new IllegalStateException(\"invalid MyBatis XML\", e); }","typeGuard":null,"tryCatchPattern":"try { engine = cfg.buildProcessEngine(); } catch (FlowableException e) { if (e.getMessage().contains(\"Could not parse\")) { log.error(\"XML parse error\", e.getCause()); } throw e; }","preventionTips":["Validate custom XML files in CI with an XML schema/linter","Avoid hand-editing mapping XML without re-validating","Check file encoding matches the XML declaration"],"tags":["flowable","mybatis","xml","parse"],"backgroundTag":"schema-validation-failed","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"}