{"record":{"id":"553a758d56cebbbf","repo":"flowable/flowable-engine","slug":"could-not-read-idm-mybatis-configuration-file","errorCode":null,"errorMessage":"Could not read IDM Mybatis configuration file","messagePattern":"Could not read IDM 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":153,"sourceCode":"                            try {\n                                typeHandlerRegistry.register(node.getAttributes().getNamedItem(\"javaType\").getTextContent(),\n                                                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 {","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfigurator.java#L135-L171","documentation":"registerCustomMybatisMappings parses the dependent engine's custom MyBatis XML configuration file from the classpath. If the file cannot be read (IOException while opening/resolving the resource), the engine throws this FlowableException.","triggerScenarios":"beforeInit -> registerCustomMybatisMappings: the custom MyBatis XML resource (e.g. referenced by a dependent engine configurator) cannot be opened via its resource path — resource missing from classpath, wrong path, unreadable stream.","commonSituations":"Custom MyBatis XML not packaged into the deployed jar/war, resource path typo, file present in source but excluded by build filters.","solutions":["Confirm the XML resource exists on the runtime classpath at the exact path referenced","Check the wrapped IOException cause for the actual path resolution problem","Add the resource to build packaging (e.g. maven resources include) if it is being filtered out"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"String path = \"custom/mybatis-mappings.xml\"; if (getClass().getClassLoader().getResource(path) == null) { throw new IllegalStateException(\"MyBatis config resource missing: \" + path); }","typeGuard":null,"tryCatchPattern":"try { engine = cfg.buildProcessEngine(); } catch (FlowableException e) { if (e.getMessage().contains(\"Could not read\")) { log.error(\"resource unreadable\", e.getCause()); } throw e; }","preventionTips":["Verify resource paths with getResource() before configuring","Check build packaging includes XML resources","Use classpath-relative paths consistently"],"tags":["flowable","mybatis","resource-loading","classpath"],"backgroundTag":"file-read-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"}