Spring Boot 3.4.1迁移,WebSecurityConfiguration中的setFilterChains需要单个bean,但找到了2个

问题描述 投票:0回答:1

通过此错误迁移到 Spring Boot 3.4.1

Description:

Parameter 0 of method setFilterChains in org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration required a single bean, but 2 were found:
    - webSocketAuthorizationManagerPostProcessor: defined by method 'webSocketAuthorizationManagerPostProcessor' in class path resource [org/springframework/security/config/annotation/web/socket/WebSocketObservationConfiguration.class]
    - objectPostProcessor: defined by method 'objectPostProcessor' in class path resource [org/springframework/security/config/annotation/configuration/ObjectPostProcessorConfiguration.class]

This may be due to missing parameter name information

有推荐

Ensure that your compiler is configured to use the '-parameters' flag.
You may need to update both your build tool settings as well as your IDE.
(See https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x#parameter-name-retention)

我已按照 Spring Framework 6.1 迁移指南

中的建议配置了 Kotlin 设置

构建.gradle.kts

tasks.withType<JavaCompile>() {
    options.compilerArgs.add("-parameters")
}

错误依然存在

有什么想法吗?

spring spring-boot spring-security
1个回答
0
投票

SEC#16299

其实这是Spring造成的。我已报告此问题

© www.soinside.com 2019 - 2024. All rights reserved.