在研究spring Security的代码,core配置类中,定义了验证码图形验证码的实体类,正常是测试项目当没有对properties的图形验证码参数进行设定时,默认读取这个实体类中的属性值。但是,如图所示,如果“url”不赋值时springboot项目启动时就报空指针,初始化空值就可以运行起来。为什么会这样呢,请高手指教。谢谢。或加QQ349769307交流
报错如下:
2019-06-30 18:48:53.628 WARN 5892 --- [ 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