hmmm ok nice to see your response but still facing problem...
i replace the class which you mention in contaxt bean
org.springframework.ldap.core.support.LdapContextS ource
now here is my spring configuration file.
Code:
<bean id="ldapContextSource"
class="org.springframework.ldap.core.support.LdapContextSource">
<property name="url" value="ldap://XXXXX:389" />
<property name="base" value="ou=schools,DC=lti-student,DC=test" />
<property name="userDn" value="XXXX" />
<property name="password" value="XXXX" />
</bean>
<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
<constructor-arg ref="ldapContextSource" />
</bean>
<bean id="ldapContactDao"
class="com.javaworld.sample.LDAPContactDAO">
<property name="ldapTemplate" ref="ldapTemplate" />
</bean>
</beans>
but with this configuration i am getting exception
Code:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldapContact' defined in class path resource [com/javaworld/sample/springldap.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.springframework.ldap.core.LdapTemplate] to required type [org.springframework.ldap.LdapTemplate] for property 'ldapTemplate'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.springframework.ldap.core.LdapTemplate] to required type [org.springframework.ldap.LdapTemplate] for property 'ldapTemplate': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at com.javaworld.sample.SpringFrameworkLDAPClient.main(SpringFrameworkLDAPClient.java:23)
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.springframework.ldap.core.LdapTemplate] to required type [org.springframework.ldap.LdapTemplate] for property 'ldapTemplate'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.springframework.ldap.core.LdapTemplate] to required type [org.springframework.ldap.LdapTemplate] for property 'ldapTemplate': no matching editors or conversion strategy found
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
... 9 more
Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [org.springframework.ldap.core.LdapTemplate] to required type [org.springframework.ldap.LdapTemplate] for property 'ldapTemplate': no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
... 13 more
what is this can you please tell me about it i also googling on that