解決Caused by: java.lang.IllegalArgumentException: A universal match pattern ('/**') is defined before other patterns in the filter chain, causing them to be ignored. Please check the ordering in your


寫項目時應用了SpringSecurity框架來進行登陸驗證,之前單獨的寫簡單的SpringSecrity的Demo時並沒有報錯,但是當和SpringMVC一起整合時卻發生了報錯

報錯如下:

Caused by: java.lang.IllegalArgumentException: A universal match pattern ('/**') is defined  before other patterns in the filter chain, 
causing them to be ignored.
Please check the ordering in your <security:http> namespace or FilterChainProxy bean configuration

 

出錯原因:

初始化配置文件發生出錯

原先初始化順序:

  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
      classpath:spring-security.xml
      classpath:applicationContext.xml
    </param-value>
  </context-param>

報錯

 

解決方法:

將applicationContext.xml在spring-security.xml之前先初始化


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM