Jndi connection pooling: a common pitfall

When enabling jndi connection pooling with java, you have to set just this context property

// Enable connection pooling
env.put("com.sun.jndi.ldap.connect.pool", "true");

But if you’re using SSL, Anonimous bind or MD5 auth, you have to specify some System properties too

com.sun.jndi.ldap.connect.pool.protocol="plain ssl"
com.sun.jndi.ldap.connect.pool.authentication="none simple DIGEST-MD5"

or ssl, anonymous and md5 connections will be excluded from the pool

info here