Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/spring

相关学习进度

https://github.com/zq99299/essay-note/blob/master/chapter/imooc/spring_security/security/%E5%9B%BE%E7%89%87%E9%AA%8C%E8%AF%81%E7%A0%81%E9%87%8D%E6%9E%84.md

配置图形验证码进行拦截的时候,针对url进行拦截,然后在配置文件中注释了相关url的配置,引发题目所示异常

配置文件中注释如下

imooc:
  security:
    browser:
      loginType: JSON

#    code:
#      image:
#        url: /user/*

异常报警如下,没有打印堆栈信息

2018-10-06 17:04:37.720  WARN 1082 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is java.lang.NullPointerException
2018-10-06 17:04:37.721  INFO 1082 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
2018-10-06 17:04:37.727  INFO 1082 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]

 

从报错信息以及进度来看,分析问题应该是出在新增的url拦截那边,配置文件没有初始配置,代码里也没有进行初始指定,导致读取不到需要的参数,无法启动。

你可能感兴趣的:(springcloud,java)