gpt4 book ai didi

java - Spring 安全警告 : Class AuthorityUtils is abstract?

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:32:19 26 4
gpt4 key购买 nike

自从迁移到 Spring Security 3.2.5.RELEASE 和 Spring 4.1.1.RELEASE 后,我们在 Eclipse (Luna) 中收到 Spring Bean Validation 警告。

确切的警告是:

“org.springframework.security.core.authority.AuthorityUtils”类是抽象的

这是这个 Spring 文件的 header :

<?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>

关于这个问题的根本原因有什么想法吗?我们的项目无法忍受虚假警告,我不想禁用 Spring bean 验证。

最佳答案

正如 Luke Taylor 所指出的,这是 Spring Tool Suite 3.6.0 版中的错误。错误报告位于 https://issuetracker.springsource.com/browse/STS-3875 , 在STS 3.6.3版本之前不会修复。您可以在 http://www.docjar.com/html/api/org/springframework/orm/jpa/SharedEntityManagerCreator.java.html 查看此类的代码

[编辑] 错误报告指出此错误现已修复。修复在版本 3.6.4 中

关于java - Spring 安全警告 : Class AuthorityUtils is abstract?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26770789/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com