【发布时间】:2019-07-13 00:23:09
【问题描述】:
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
这是什么错误?我找不到它的任何来源。
【问题讨论】:
-
如果你检查
java.lang.NoClassDefFoundError: org/springframework/security/web/debug/DebugFilter这一行,你会发现它在你的项目中找不到这个类。你确定你的类路径中有 jar spring-security-web 吗?试试这个链接来获取 jar,在 maven 或 gradle 中使用:[mvnrepository.com/artifact/org.springframework.security/…]。这很可能会解决问题。 -
类丢失...
标签: java spring spring-boot