-
May 18th, 2011, 04:29 PM
#1
SpringLdap PoolingContextSource issue - URGENT Please HELP
Please help me!! I have been struggling and trying trying to get rid of CommunicationExecption every time.. not sure.. If I am doing some stupid.. I am using spring-ldap-1.3.1.RELEASE.. We've decided to use spring ldap.. after our initial POC went well........ !!
First time I am calling my service.. its working very good with below configuration and pooled the DirContext which is created by DirContextPoolableObjectFactory
If I trigger same call for ldap search in few seconds... Its not creating new one.. using old one.. that also excellent.. here are the questions..
Q1) If I trigger same ldap search after a minute... testOnBorrow=false its welcoming with below error... with testOnBorrow=true, its giving error.. and working well.... why in a minute giving error.. how long will it be active.... with out error.. how to configure that for active object/connection for longer time... if we can ?
Q2) testOnBorrow doing some attempt to LDAP when the object/connection to ldap is not valid.....well, our LDAP admin says that its doing very bad search attempt...
Can we customise this search attempt using custom search criteria... instead of leaving it to DefaultDirContextValidator
Debug Log
----------
DEBUG, ldap.pool.factory.DirContextPoolableObjectFactory, (), (Creating a new READ_ONLY DirContext)
DEBUG, ldap.pool.factory.DirContextPoolableObjectFactory, (), (Created new READ_ONLY DirContext='javax.naming.ldap.InitialLdapContext@1 eeef8c')
Error Log
---------
org.springframework.ldap.CommunicationException: connection closed; nested exception is javax.naming.Communica
tionException: connection closed [Root exception is java.io.IOException: connection closed]; remaining name ''
at org.springframework.ldap.support.LdapUtils.convert LdapException(LdapUtils.java:100)
at org.springframework.ldap.core.LdapTemplate.search( LdapTemplate.java:319)
at org.springframework.ldap.core.LdapTemplate.search( LdapTemplate.java:259)
at org.springframework.ldap.core.LdapTemplate.search( LdapTemplate.java:606)
at org.springframework.ldap.core.LdapTemplate.search( LdapTemplate.java:524)
at org.springframework.ldap.core.LdapTemplate.search( LdapTemplate.java:473)
at org.springframework.ldap.core.LdapTemplate.search( LdapTemplate.java:493)
at org.springframework.ldap.core.LdapTemplate.search( LdapTemplate.java:513)
Below is my configuration
------------------------
<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate" >
<property name="contextSource" ref="poolingContextSource" />
</bean>
<bean id="poolingContextSource" class="org.springframework.ldap.pool.factory.Pooli ngContextSource">
<property name="contextSource" ref="contextSourceTarget" />
<property name="dirContextValidator" ref="dirContextValidator" />
<property name="testOnBorrow" value="false" />
<property name="testWhileIdle" value="false" />
<property name="minEvictableIdleTimeMillis" value="1000"/>
</bean>
<bean id="dirContextValidator" class="org.springframework.ldap.pool.validation.De faultDirContextValidator">
<property name="filter" value="tiaacustomernum=234567"/>
</bean>
<bean id="contextSourceTarget" class="org.springframework.ldap.core.support.LdapC ontextSource">
<property name="url" value="ldap://10.199.27.160:2389" />
<property name="base" value="dc=tiaa-cref,dc=org" />
<property name="userDn" value="uid=smuser,ou=people,dc=tiaa-cref,dc=org" />
<property name="password" value="abcd1234" />
<property name="pooled" value="false"/>
<property name="baseEnvironmentProperties">
<map>
<entry key="com.sun.jndi.ldap.connect.timeout" value="1000" /> <!-- 1 sec -->
<entry key="com.sun.jndi.ldap.connect.pool.debug" value="true"/>
</map>
</property>
</bean>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules