java.io.FileNotFoundException: class path resource [org/springframework/security/config/annotation/authentication/configurers/GlobalAuthenticationConfigurerAdapter.class] cannot be opened because it does not exist
时间: 2023-06-13 14:02:21 浏览: 262
was not found on the java.library.path
这个错误提示是因为你的项目缺少了 Spring Security 的相关依赖。
你需要在项目的 pom.xml 文件中添加以下依赖:
```
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>5.3.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>5.3.4.RELEASE</version>
</dependency>
```
如果你使用的是 Gradle,可以在 build.gradle 文件中添加以下依赖:
```
implementation 'org.springframework.security:spring-security-config:5.3.4.RELEASE'
implementation 'org.springframework.security:spring-security-web:5.3.4.RELEASE'
```
添加完依赖之后,重新构建项目,该错误就会被解决。
阅读全文