{"record":{"id":"62f5cdd424045508","repo":"flowable/flowable-engine","slug":"error-while-building-ibatis-sqlsessionfactory","errorCode":null,"errorMessage":"Error while building ibatis SqlSessionFactory: ","messagePattern":"Error while building ibatis SqlSessionFactory: ","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java","lineNumber":842,"sourceCode":"\n                // set default properties\n                properties.put(\"limitBefore\", \"\");\n                properties.put(\"limitAfter\", \"\");\n                properties.put(\"limitBetween\", \"\");\n                properties.put(\"limitBeforeNativeQuery\", \"\");\n                properties.put(\"limitAfterNativeQuery\", \"\");\n                properties.put(\"blobType\", \"BLOB\");\n                properties.put(\"boolValue\", \"TRUE\");\n\n                if (databaseType != null) {\n                    properties.load(getResourceAsStream(pathToEngineDbProperties()));\n                }\n\n                Configuration configuration = initMybatisConfiguration(environment, reader, properties);\n                sqlSessionFactory = new DefaultSqlSessionFactory(configuration);\n\n            } catch (Exception e) {\n                throw new FlowableException(\"Error while building ibatis SqlSessionFactory: \" + e.getMessage(), e);\n            } finally {\n                IoUtil.closeSilently(inputStream);\n            }\n        } else {\n            // This is needed when the SQL Session Factory is created by another engine.\n            // When custom XML Mappers are registered with this engine they need to be loaded in the configuration as well\n            applyCustomMybatisCustomizations(sqlSessionFactory.getConfiguration());\n        }\n    }\n\n    public String pathToEngineDbProperties() {\n        return \"org/flowable/common/db/properties/\" + databaseType + \".properties\";\n    }\n\n    public Configuration initMybatisConfiguration(Environment environment, Reader reader, Properties properties) {\n        XMLConfigBuilder parser = new XMLConfigBuilder(reader, \"\", properties);\n        Configuration configuration = parser.getConfiguration();\n","sourceCodeStart":824,"sourceCodeEnd":860,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/AbstractEngineConfiguration.java#L824-L860","documentation":"The engine builds its MyBatis SqlSessionFactory from the bundled MyBatis XML mapping configuration. If any exception occurs while reading or initializing that configuration, it is rethrown as this FlowableException with the original cause attached.","triggerScenarios":"AbstractEngineConfiguration.initSqlSessionFactory() when parsing/loading the MyBatis XML config or initMybatisConfiguration fails: corrupt/unreadable XML resource, bad custom type alias/type handler registration, missing mybatis dependency, incompatible mapping XML.","commonSituations":"Custom MyBatis XML mappers registered incorrectly, classpath packaging issues (config XML missing from jar), conflicting MyBatis versions on the classpath, invalid custom type alias/type handler entries.","solutions":["Inspect the wrapped cause (e.getCause()) for the real MyBatis failure","Verify the MyBatis XML mapping files exist on the classpath and are valid","Check for MyBatis version conflicts in the dependency tree (mvn dependency:tree)","Fix any custom type alias/type handler registrations referenced in the config"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { engine = cfg.buildProcessEngine(); } catch (FlowableException e) { if (e.getMessage().startsWith(\"Error while building ibatis SqlSessionFactory\")) { log.error(\"MyBatis init failed\", e.getCause()); } throw e; }","preventionTips":["Keep one MyBatis version aligned with your Flowable version","Validate custom MyBatis XML and alias/handler classes before startup","Ensure mapping XML resources are packaged in the deployed artifact"],"tags":["flowable","mybatis","sql-session-factory","initialization"],"backgroundTag":"module-init-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"}