小编A T*_*mas的帖子

Intellij IDEA 错误 - 无法自动装配。未找到“HttpSecurity”类型的 bean

我正在尝试以下示例

https://github.com/lspil/blog/tree/master/endpoint-authorization-methods/spring-security-endpoint-authorization-new

并且在 Intellij IDEA 中运行正常,没有任何错误。但是当我在pom.xml中将 Spring Boot 版本从2.4.4更改为2.7.1时,它会抛出 IDE 错误:

无法自动装配。 未找到以下“HttpSecurity”类型的 bean :

  @Bean
  public SecurityFilterChain configuration(HttpSecurity httpSecurity) throws Exception {
  ..........................
Run Code Online (Sandbox Code Playgroud)

该应用程序运行良好,但有兴趣知道为什么会发生这种情况。IDE版本为IntelliJ IDEA 2022.1(终极版)

intellij-idea spring-security spring-boot

8
推荐指数
1
解决办法
2万
查看次数