为什么在将 Bcrypt 添加到我的 Spring-Security.XML 文件时出现 IllegalStateException?

Why Am I Getting an IllegalStateException While Adding Bcrypt to my Spring-Security.XML file?

我已经在我正在做的一个小应用程序上实现了 bCrypt 编码。目前,我可以创建一个用户,并加密密码。在加密之前,我可以让用户使用他们的电子邮件地址和存储在数据库中的纯文本密码登录。现在,当我只是 运行 从 Eclipse 中退出应用程序时,我收到了 404 错误。

在我的 spring-security.xml 文件中添加以下行后才开始出现错误

        <password-encoder ref="encoder" />  

我在控制台中看到的错误如下。

Caused by: java.lang.IllegalStateException: Cannot convert value of type [org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder] to required type [org.springframework.security.authentication.encoding.PasswordEncoder] for property 'passwordEncoder': no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:447)

这是我在 XML.

中实现 Bcrypt 的方式
 <authentication-manager alias="authenticationManager">
    <authentication-provider>
    <password-encoder ref="encoder" />  
        <jdbc-user-service data-source-ref="dataSource"
            users-by-username-query="
            SELECT email as username, passwordConfig as password, active as enabled 
            FROM Employee
            WHERE email=?"
            authorities-by-username-query="
            SELECT email as username, role 
            FROM EmployeeLEFT OUTER JOIN Roles 
            ON Employee.RoleID=Roles.roleId 
            WHERE email=?" />
    </authentication-provider>
</authentication-manager>

<beans:bean id="encoder" 
class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder">
<beans:constructor-arg name="strength" value="11" />

这是我的 spring 个库。

antlr-2.7.6.jar
aopalliance-1.0.jar
com.springsource.org.aopalliance-1.0.0.jar
commons-beanutils-1.9.2.jar
commons-collections-3.2.1.jar
commons-digester-2.0.jar
commons-fileupload-1.3.1.jar
commons-io-2.4.jar
commons-logging-1.1.1.jar
dom4j-1.6.1.jar
hibernate3.jar
hibernate-jpa-2.0-api-1.0.0.Final.jar
hibernate-validator-4.2.0.Final.jar
javassist-3.12.0.GA.jar
javax.servlet.jar
jbcrypt-0.3m.jar
jcl-over-slf4j-1.5.8.jar
jstl-1.2.jar
jta-1.1.jar
mail-1.4.7.jar
org.springframework.aop-3.0.5.RELEASE.jar
org.springframework.asm-3.0.5.RELEASE.jar
org.springframework.aspects-3.0.5.RELEASE.jar
org.springframework.beans-3.0.5.RELEASE.jar
org.springframework.context.support-3.0.5.RELEASE.jar
org.springframework.context-3.0.5.RELEASE.jar
org.springframework.core-3.0.5.RELEASE.jar
org.springframework.expression-3.0.5.RELEASE.jar
org.springframework.instrument.tomcat-3.0.5.RELEASE.jar
org.springframework.instrument-3.0.5.RELEASE.jar
org.springframework.jdbc-3.0.5.RELEASE.jar
org.springframework.jms-3.0.5.RELEASE.jar
org.springframework.orm-3.0.5.RELEASE.jar
org.springframework.oxm-3.0.5.RELEASE.jar
org.springframework.test-3.0.5.RELEASE.jar
org.springframework.transaction-3.0.5.RELEASE.jar
org.springframework.web.portlet-3.0.5.RELEASE.jar
org.springframework.web.servlet-3.0.5.RELEASE.jar
org.springframework.web.struts-3.0.5.RELEASE.jar
org.springframework.web-3.0.5.RELEASE.jar
slf4j-api-1.6.1.jar
slf4j-nop-1.6.1.jar
spring-beans-2.5.6.jar
spring-context-2.5.6.jar
spring-core-2.5.6.jar
spring-security-acl-3.0.5.RELEASE.jar
spring-security-aspects-3.0.5.RELEASE.jar
spring-security-cas-client-3.0.5.RELEASE.jar
spring-security-config-3.0.5.RELEASE.jar
spring-security-core-3.0.5.RELEASE.jar
spring-security-crypto-3.1.1.RELEASE.jar
spring-security-ldap-3.0.5.RELEASE.jar
spring-security-openid-3.0.5.RELEASE.jar
spring-security-taglibs-3.0.5.RELEASE.jar
spring-security-web-3.0.5.RELEASE.jar
spring-web-2.5.6.jar
spring-webmvc-portlet-2.5.6.jar
sqljdbc4.jar
tiles-api-2.2.2.jar
tiles-core-2.2.2.jar
tiles-jsp-2.2.2.jar
tiles-servlet-2.2.2.jar
tiles-template-2.2.2.jar
validation-api-1.0.0.GA.jar

我将版本更新为 Spring Framework 3.2.7,现在错误消失了。