Code: Select all
java.lang.Exception
at org.apache.commons.pool2.impl.BaseGenericObjectPool.(BaseGenericObjectPool.java:420)
at org.apache.commons.pool2.impl.GenericObjectPool.(GenericObjectPool.java:150)
at org.apache.directory.ldap.client.api.LdapConnectionPool.(LdapConnectionPool.java:97)
at org.apache.directory.ldap.client.api.LdapConnectionPool.(LdapConnectionPool.java:85)
at someorg.api.application.config.ApplicationConfig.init(ApplicationConfig.java:51)
Code: Select all
DefaultPoolableLdapConnectionFactory factory = new DefaultPoolableLdapConnectionFactory(config);
Code: Select all
@PostConstruct
public void init()
{
ApplicationConfig.setLoggingLevel(rootLogger, Level.SEVERE);
// Config LDAP connection
LdapConnectionConfig config = new LdapConnectionConfig();
config.setLdapHost("someurl.org");
config.setLdapPort(389);
config.setUseSsl(false);
config.setName("somename");
config.setCredentials("somepassword");
DefaultPoolableLdapConnectionFactory factory = new DefaultPoolableLdapConnectionFactory(config);
rootLogger.log(Level.INFO, "LDAP pooled factory initialized.");
// Instantiate LDAP factory
pool = new LdapConnectionPool(factory);
pool.setMaxTotal(20);
pool.setMaxIdle(20);
pool.setMinIdle(5);
pool.setMaxWaitMillis(3000);
pool.setTestOnBorrow(true);
rootLogger.log(Level.INFO, "LDAP Pool initialized");
}
Code: Select all
org.apache.directory.api
api-ldap-client-api
2.1.0