NullPointerException at org.springframework.security.web.FilterChainProxy.getFilters

后端 未结 2 2046
自闭症患者
自闭症患者 2021-01-22 04:20

I tried to use spring-security, and get this error.

java.lang.NullPointerException
at org.springframework.security.web.FilterChainProxy.getFilters(FilterChainPro         


        
2条回答
  •  终归单人心
    2021-01-22 04:59

    You are creating a FilterChainProxy bean with an null filter list in your XML configuration and this bean is than used in the web.xml by DelegatingFilterProxy. FilterChainProxy#getFilters tries to iterate over the null list and naturally fails with a NullPointerException.

    The root of the problem is, that you cannot mix Java configuration and traditional XML configuration like this. The Java configuration creates a separate FilterChainProxy bean that has nothing to do with the bean configured via XML.

提交回复
热议问题