Spring 安全框架 2.6.4 出现错误(getInterfaceMethodIfPossible 的 NoSuchMethodError)

发布于 2025-01-15 19:30:53 字数 806 浏览 2 评论 0原文

更新到 Spring boot 2.6.4 后,当我尝试调用我的其余控制器时,我收到此错误:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': Unsatisfied dependency expressed through method 'setFilterChainProxySecurityConfigurer' parameter 1; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is java.lang.NoSuchMethodError: 'java.lang.reflect.Method org.springframework.util.ClassUtils.getInterfaceMethodIfPossible(java.lang.reflect.Method, java.lang.Class)'

直到 2.6.3 才会出现问题

我尝试添加:

@EnableWebSecurity
@EnableWebMvc

到我的 WebSecurityConfigurerAdapter 类,但这不会产生任何差异

After the update to Spring boot 2.6.4, I get this error while i try to call my rest controllers:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': Unsatisfied dependency expressed through method 'setFilterChainProxySecurityConfigurer' parameter 1; nested exception is org.springframework.beans.factory.BeanExpressionException: Expression parsing failed; nested exception is java.lang.NoSuchMethodError: 'java.lang.reflect.Method org.springframework.util.ClassUtils.getInterfaceMethodIfPossible(java.lang.reflect.Method, java.lang.Class)'

The problem does not occur until 2.6.3

I tried to add:

@EnableWebSecurity
@EnableWebMvc

To my WebSecurityConfigurerAdapter class, but that produces no difference

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

大海や 2025-01-22 19:30:56

Spring Boot 2.6.4 应与 Spring Framework 5.3.16 一起使用,但您使用的是早期版本。您需要更新 Maven 或 Gradle 配置来纠正此问题。我建议使用 Spring Boot 的依赖管理来保持版本同步。

Spring Boot 2.6.4 should be used with Spring Framework 5.3.16 but you are using an earlier version. You need to update your Maven or Gradle configuration to correct this. I’d recommend using Spring Boot’s dependency management to keep versions in sync.

残月升风 2025-01-22 19:30:56

将 spring-core 版本升级到 5.3.16 解决了这个问题。

Upgrading spring-core version to 5.3.16 solved this issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文