{"record":{"id":"6f71630c75ebc971","repo":"flowable/flowable-engine","slug":"ldapconfiguration-is-not-set","errorCode":null,"errorMessage":"ldapConfiguration is not set","messagePattern":"ldapConfiguration is not set","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"critical","filePath":"modules/flowable-ldap-configurator/src/main/java/org/flowable/ldap/LDAPConfigurator.java","lineNumber":47,"sourceCode":" * \n * @author Joram Barrez\n */\npublic class LDAPConfigurator extends IdmEngineConfigurator {\n\n    protected LDAPConfiguration ldapConfiguration;\n\n    @Override\n    public void beforeInit(AbstractEngineConfiguration engineConfiguration) {\n        // Nothing to do\n    }\n\n    @Override\n    public void configure(AbstractEngineConfiguration engineConfiguration) {\n        \n        this.idmEngineConfiguration = new LdapIdmEngineConfiguration();\n        \n        if (ldapConfiguration == null) {\n            throw new FlowableException(\"ldapConfiguration is not set\");\n        }\n\n        LDAPGroupCache ldapGroupCache = null;\n        if (ldapConfiguration.getGroupCacheSize() > 0) {\n            ldapGroupCache = new LDAPGroupCache(ldapConfiguration.getGroupCacheSize(), \n                    ldapConfiguration.getGroupCacheExpirationTime(), engineConfiguration.getClock());\n            \n            if (ldapConfiguration.getGroupCacheListener() != null) {\n                ldapGroupCache.setLdapCacheListener(ldapConfiguration.getGroupCacheListener());\n            }\n        }\n        \n        super.configure(engineConfiguration);\n        \n        getIdmEngineConfiguration(engineConfiguration)\n                .setIdmIdentityService(new LDAPIdentityServiceImpl(ldapConfiguration, ldapGroupCache, idmEngineConfiguration));\n    }\n","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-ldap-configurator/src/main/java/org/flowable/ldap/LDAPConfigurator.java#L29-L65","documentation":"LDAPConfigurator.configure() wires the LDAP identity/proxy setup into a Flowable engine, but it can only do so when an LDAPConfiguration instance has been provided. If the 'ldapConfiguration' field on the configurator is still null when the engine boots, configuration cannot proceed and a FlowableException is thrown immediately, aborting engine startup. This is a fail-fast guard so a misconfigured engine never starts without its LDAP backing.","triggerScenarios":"Creating a new LDAPConfigurator() and registering it via engineConfigurator list (e.g. config.setConfigurators/addConfigurator) without ever calling setLdapConfiguration(...). Also when the LDAPConfiguration bean is wired in Spring but the setter is bypassed or the property is missing from the config file.","commonSituations":"Spring XML/properties wiring where the ldapConfiguration bean reference is missing; copying a bootstrapping snippet that adds the configurator but omits the configuration object; upgrading Flowable and dropping the LDAP config from application context; hand-rolled programmatic engine setup for tests.","solutions":["Instantiate an LDAPConfiguration, populate its connection fields, and call ldapConfigurator.setLdapConfiguration(ldapConfiguration) BEFORE the engine is initialized.","If using Spring, verify the configurator bean receives the ldapConfiguration bean reference (property/constructor injection).","Ensure the configurator is only added to the engine configuration after the LDAPConfiguration is fully constructed.","Add a startup self-check that asserts getLdapConfiguration() != null before building the process engine."],"exampleFix":"// before\nLDAPConfigurator configurator = new LDAPConfigurator();\nprocessEngineConfiguration.setConfigurators(Collections.singletonList(configurator));\n// after\nLDAPConfigurator configurator = new LDAPConfigurator();\nLDAPConfiguration ldapConfiguration = new LDAPConfiguration();\nldapConfiguration.setLdapServer(\"ldap://localhost\");\nldapConfiguration.setPort(10389);\nldapConfiguration.setUser(\"cn=admin,dc=flowable,dc=org\");\nldapConfiguration.setPassword(\"pass\");\nldapConfiguration.setBaseDn(\"dc=flowable,dc=org\");\nconfigurator.setLdapConfiguration(ldapConfiguration);\nprocessEngineConfiguration.setConfigurators(Collections.singletonList(configurator));","handlingStrategy":"validation","validationCode":"LDAPConfigurator configurator = new LDAPConfigurator();\nif (configurator.getLdapConfiguration() == null) {\n    configurator.setLdapConfiguration(buildLdapConfiguration()); // must be set before engine init\n}\nprocessEngineConfiguration.setConfigurators(Collections.singletonList(configurator));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always call setLdapConfiguration() immediately after constructing LDAPConfigurator.","In Spring, wire the ldapConfiguration bean reference explicitly in the configurator bean definition.","Assert configurator.getLdapConfiguration() != null in a startup smoke test.","Keep LDAP connection settings in one config object/property file to avoid dropping them during refactors."],"tags":["ldap","configuration","engine-startup","missing-config"],"backgroundTag":"missing-required-config","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"}