由于转到了Spring Security 3.2.5.RELEASE和Spring 4.1.1.RELEASE,我们在Eclipse(Luna)中收到了Spring Bean Validation警告。
确切的警告是:
Class 'org.springframework.security.core.authority.AuthorityUtils' is abstract
这是这个Spring文件的标题:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:springsecurity="http://www.springframework.org/schema/security"
xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:cxf="http://cxf.apache.org/core"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.1.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd">
配置中有问题的部分如下(这意味着如果我删除这一部分,错误就会消失。特别是,如果我删除springsecurity:authentication-provider
节:
<springsecurity:authentication-manager alias="authenticationManager">
<springsecurity:authentication-provider>
<springsecurity:user-service>
<springsecurity:user name="john" password="john"
authorities="ROLE_USER" />
<springsecurity:user name="admin" password="admin"
authorities="ROLE_USER, ROLE_ADMIN" />
<springsecurity:user name="guest" password="guest"
authorities="ROLE_GUEST" />
</springsecurity:user-service>
</springsecurity:authentication-provider>
</springsecurity:authentication-manager>
关于这件事的根本原因有什么想法吗?我们的项目不会容忍虚假的警告,我不想禁用Springbean验证。
[编辑]错误报告指出,此错误现已修复。修复程序在3.6.4版本
中