解决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