我构建异步球衣web服务,现在我需要使用ldap进行一些操作。 我在这个模式下配置Spring beam.xml:Spring ldap pooling出错
<bean id="contextSourceTarget" class="org.springframework.ldap.core.support.LdapContextSource">
<property name="url" value="${ldap.url}" />
<property name="base" value="${ldap.base}" />
<property name="userDn" value="${ldap.userDn}" />
<property name="password" value="${ldap.password}" />
<property name="pooled" value="false" />
</bean>
<bean id="contextSource"
class="org.springframework.ldap.pool.factory.PoolingContextSource">
<property name="contextSource" ref="contextSourceTarget" />
</bean>
<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
<constructor-arg ref="contextSource" />
</bean>
<bean id="ldapTreeBuilder" class="com.me.ldap.LdapTreeBuilder">
<constructor-arg ref="ldapTemplate" />
</bean>
<bean id="personDao" class="com.me.ldap.PersonDaoImpl">
<property name="ldapTemplate" ref="ldapTemplate" />
</bean>
但是,当我尝试使用LDAP我有这样的错误:
Error creating bean with name 'contextSource' defined in class path resource [config/Beans.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/KeyedPoolableObjectFactory
在我的项目,我有公地pool2-2.2.jar LIB,但我仍然有这个error..i尝试添加公地pool2-2.2.jar在TOMCAT_PATH/lib目录但不是工程..
UPDATE:
如果我把commons-pool-1.6.jar工作..但如果我想使用pool2我该怎么办?只有我必须改变class class commons-pool2-2.2.jar?
现在支持commons-pool2 – Marged 2017-02-15 22:15:53