Add Custom Mybatis XML Mapper using java configuration as separate jar file


I would like to add my custom REST APIs. So I have to add CustomMybatisXMLMapper in process engine configuration. I have created a jar file in which spring.factories contains a class to be loaded as configuration. Below is the class

// Makes sure that this configuration will be processed last by Spring Boot
// The configuration will only be used when the ProcessEngine bean is present
@ConditionalOnBean(type = "org.flowable.engine.ProcessEngine")
public class FlowableWorkflowEngineConfig {

    public EngineConfigurationConfigurer<SpringProcessEngineConfiguration> customProcessEngineConfigurationConfigurer() {
        return engineConfiguration -> {
            // You can use this to add extra configuration to the process engine
            if (engineConfiguration.getCustomMybatisXMLMappers() == null) {
                engineConfiguration.setCustomMybatisXMLMappers(new HashSet<>());


When I run query it throws error Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for.

Now if I define the mapper in file using following setting then it works.


So is there a way to initialize CustomMybatisXMLMapper configuration without updating file?


1 Like