Click here to Skip to main content
15,887,374 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have a problem with getContext(userDN,password) method when I pass the valid userDn and password also it shows some error like the implementation is not supported.
I have used the context.xml like this:
XML
<bean id="contextSource" class="org.springframework.ldap.pool.factory.Pooli ngContextSource">
  <property name="contextSource" ref="contextSourceTarget" />
</bean>

<bean id="contextSourceTarget" class="org.springframework.ldap.core.support.LdapC ontextSource">
  <property name="url" value="url" />
  <property name="base" value="dc=xxx,dc=com" />
  <property name="userDn" value="uid=bind,ou=System,dc=xxx,dc=com" />
  <property name="password" value="bind" />
  <property name="pooled" value="true"></property>
</bean>

<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
  <constructor-arg ref="contextSource" />
</bean>

<bean id="springLDAPService" class="com.service.serviceimpl" depends-on="ldapConstants">
  <property name="ldapTemplate" ref="ldapTemplate" />
  <property name="contextSource" ref="contextSource"></property>
  <property name="userValidationContextSource" ref="userValidationContextSource" /> 
</bean>

After this, the context source I am injecting in the serviceimpl class and calling the method like
ctx=contextSource.getContext(userDn, password);

When I use the contextSource of PoolingContextSource it is throwing exception
but when I use the LDAPContextSource it is executing but the problem is the
LdapUtils.closeContext(ctx); is not working means context object is not closing in this like the above one
Any help will be appreciated. Please help, it is very urgent.
Posted
Updated 16-Feb-11 19:09pm
v2
Comments
JF2015 17-Feb-11 1:09am    
Added code formatting.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900