0
即时得到以下异常尝试配置上春季LDAPTemplate -无效属性 'defaultCountLimit'[org.springframework.ldap.core.LdapTemplate]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldapTemplate': Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'defaultCountLimit' of bean class [org.springframework.ldap.core.LdapTemplate]: Bean property 'defaultCountLimit' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
我的配置是 -
<ldap:context-source
id="contextSource"
url="myurl"
base="mybase"
username="myuser"
password="mypassword"
referral="follow"
/>
<ldap:ldap-template id="ldapTemplate" context-source-ref="contextSource" />
伊夫检查的配置,它工作正常,当我不通过弹簧环境中工作 -
LdapContextSource contextSource = new LdapContextSource();
contextSource.setUrl("myurl");
contextSource.setBase("mybase");
contextSource.setUserDn("myuser");
contextSource.setPassword("mypassword");
contextSource.setReferral("follow");
contextSource.afterPropertiesSet();
LdapTemplate ldapTemplate = new LdapTemplate(contextSource);
ldapTemplate.afterPropertiesSet();
我看不到countlimit被设置为导致此问题的位置。我也尝试通过ldap-template设置最大值。
版本 -
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap</artifactId>
<version>1.3.1.RELEASE</version>
<classifier>all</classifier>
</dependency>
是的 - 有一个旧的ldap lib被我忽略的项目的另一部分导入 - 谢谢 – farrellmr