Java Spring启动应用程序运行失败
这个错误是什么?我找不到它的任何来源。项目缺少依赖项。在pom.xml中添加以下依赖项Java Spring启动应用程序运行失败,java,spring,spring-boot,Java,Spring,Spring Boot,这个错误是什么?我找不到它的任何来源。项目缺少依赖项。在pom.xml中添加以下依赖项 2019-07-12 17:32:57.619 WARN 24158 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.con
2019-07-12 17:32:57.619 WARN 24158 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': Injection of autowired dependencies failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/security/web/debug/DebugFilter
2019-07-12 17:32:57.639 ERROR 24158 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': Injection of autowired dependencies failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/security/web/debug/DebugFilter
org.springframework.security
spring安全网
如果您选中这一行java.lang.NoClassDefFoundError:org/springframework/security/web/debug/DebugFilter
,您将看到它在项目中找不到此类。您确定您的类路径中有jar spring安全web吗?尝试此链接获取jar,在maven或gradle中使用:[]。这很可能会解决问题。缺少类…问题已解决。所有spring安全依赖项版本都需要匹配。为什么会这样呢?谢谢大家。
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
</dependency>