Java 通用匹配>;模式(';/**';)在过滤器链中的其他模式之前定义

Java 通用匹配>;模式(';/**';)在过滤器链中的其他模式之前定义,java,spring,spring-security,Java,Spring,Spring Security,我有一个我再也无法处理的问题。它是关于将应用程序扩展到Spring安全性的 为此,我创建了一个security.xml文件(见下文) 在web.xml中,我包含了这个文件 但是,我在启动应用程序时收到以下错误消息: 原因:java.lang.IllegalArgumentException:通用匹配 模式(“/**”)是在过滤器链中的其他模式之前定义的, 导致他们被忽视。请在您的邮箱中查看订单 命名空间或FilterChainProxy bean配置 我已经上网好几天了。然而,我还没有找到解决办

我有一个我再也无法处理的问题。它是关于将应用程序扩展到Spring安全性的

为此,我创建了一个security.xml文件(见下文)

在web.xml中,我包含了这个文件

但是,我在启动应用程序时收到以下错误消息:

原因:java.lang.IllegalArgumentException:通用匹配 模式(“/**”)是在过滤器链中的其他模式之前定义的, 导致他们被忽视。请在您的邮箱中查看订单 命名空间或FilterChainProxy bean配置

我已经上网好几天了。然而,我还没有找到解决办法

security.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:security="http://www.springframework.org/schema/security"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
                        http://www.springframework.org/schema/beans/spring-beans.xsd
                        http://www.springframework.org/schema/security
                        https://www.springframework.org/schema/security/spring-security.xsd">

  <security:http auto-config="true">
      <security:intercept-url
          pattern="/ResetPassword**" access="IS_AUTHENTICATED_ANONYMOUSLY" />
      <security:headers defaults-disabled="true">
          <security:frame-options policy="SAMEORIGIN"/>
      </security:headers>
  </security:http>

  <security:authentication-manager>
      <security:authentication-provider>
          <security:user-service>
              <security:user name="abc" authorities="IS_AUTHENTICATED_ANONYMOUSLY" />
          </security:user-service>
      </security:authentication-provider>
  </security:authentication-manager>

</beans>

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:security="http://www.springframework.org/schema/security"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
                        http://www.springframework.org/schema/beans/spring-beans.xsd
                        http://www.springframework.org/schema/security
                        https://www.springframework.org/schema/security/spring-security.xsd">

  <security:http auto-config="true">
      <security:intercept-url
          pattern="/ResetPassword**" access="IS_AUTHENTICATED_ANONYMOUSLY" />
      <security:headers defaults-disabled="true">
          <security:frame-options policy="SAMEORIGIN"/>
      </security:headers>
  </security:http>

  <security:authentication-manager>
      <security:authentication-provider>
          <security:user-service>
              <security:user name="abc" authorities="IS_AUTHENTICATED_ANONYMOUSLY" />
          </security:user-service>
      </security:authentication-provider>
  </security:authentication-manager>

</beans>

DQI调度程序
上下文初始化类
de.bund.bsi.pliscommon.dqischeduler.common.spring.ApplicationsSpringWebInitializer
WebApprotKey
dqi调度程序
javax.faces.DEFAULT_后缀
.xhtml
javax.faces.PROJECT_阶段
生产
javax.faces.FACELETS\u刷新\u周期
1.
logbackConfigLocation
类路径:/config/logback.xml
javax.faces.FACELETS\u缓冲区\u大小
202400
上下文配置位置
类路径:resources/spring/application-web.xml
/WEB-INF/security.xml
javax.faces.FACELETS\u跳过\u注释
真的
扩展过滤器
org.apache.myfaces.webapp.filter.ExtensionsFilter
上传MaxFileSize
10米
上载阈值大小
500k
RequestContextFilter
org.springframework.web.filter.RequestContextFilter
MDC过滤器
de.bund.bva.pliscommon.aufrufContext.http.HttpHeaderNestedDiagnosticContextFilter
SpringSecurityFilter
org.springframework.web.filter.DelegatingFilterProxy
塔吉特比纳姆
springSecurityFilterChain
字符编码滤波器
org.springframework.web.filter.CharacterEncodingFilter
编码
utf-8
强制编码
真的
应用程序初始化筛选器
de.bund.bva.isyfact.common.web.servlet.filter.ApplicationInitializierUngFilter
urlsToSkip
/app/resources,/app/javax.faces.resource
urlApplicationInitialisierung
/app/common/init/applicationInitializierung.xhtml
ajaxURL
/dqi调度程序/index.html
身份验证过滤器
org.springframework.web.filter.DelegatingFilterProxy
塔吉特比纳姆
configurableAuthenticationFilter
targetFilterLifecycle
真的
GeneralGuiAuthorizationFilter
org.springframework.web.filter.DelegatingFilterProxy
塔吉特比纳姆
配置授权筛选器
targetFilterLifecycle
真的
身份验证过滤器
/应用程序/*
RequestContextFilter
/*
MDC过滤器
/*
GeneralGuiAuthorizationFilter
/应用程序/*
SpringSecurityFilter
/应用程序/*
字符编码滤波器
/*
应用程序初始化筛选器
/应用程序/*
ch.qos.logback.ext.spring.web.LogbackConfigListener
org.springframework.web.context.ContextLoaderListener
Facesservlet
javax.faces.webapp.FacesServlet
1.
SpringMVCServlet
org.springframework.web.servlet.DispatcherServlet
上下文配置位置
类路径:resources/spring/gui.xml
1.
远程处理
org.springframework.web.servlet.DispatcherServlet
上下文配置位置
/WEB-INF/classes/resources/spring/service/remoting-servlet.xml
1.
扩展过滤器
SpringMVCServlet
负载平衡器
de.bund.bva.pliscommon.ueberwachung.service.loadbalancer.LoadbalancerServlet
1.
Facesservlet
*.面孔
SpringMVCServlet
/应用程序/*
远程处理
/AdminBean\u v1\u 0
负载平衡器
/负载平衡器
index.html
`

整个控制台输出

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChainProxy': Invocation of init method failed; nested exception is 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
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:778)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:843)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
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
    at org.springframework.security.config.http.DefaultFilterChainValidator.checkPathOrder(DefaultFilterChainValidator.java:53)
    at org.springframework.security.config.http.DefaultFilterChainValidator.validate(DefaultFilterChainValidator.java:40)
    at org.springframework.security.web.FilterChainProxy.afterPropertiesSet(FilterChainProxy.java:167)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579)
    ... 21 common frames omitted
[P: ERROR] [T: localhost-startStop-1] [L: org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/dqi-scheduler]] - [M: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]] 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChainProxy': Invocation of init method failed; nested exception is 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
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:778)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:843)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
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
    at org.springframework.security.config.http.DefaultFilterChainValidator.checkPathOrder(DefaultFilterChainValidator.java:53)
    at org.springframework.security.config.http.DefaultFilterChainValidator.validate(DefaultFilterChainValidator.java:40)
    at org.springframework.security.web.FilterChainProxy.afterPropertiesSet(FilterChainProxy.java:167)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579)
    ... 21 common frames omitted
[P: ERROR] [T: localhost-startStop-1] [L: org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/dqi-scheduler]] - [M: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]] 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChainProxy': Invocation of init method failed; nested exception is 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
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:778)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:843)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:444)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:326)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
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
    at org.springframework.security.config.http.DefaultFilterChainValidator.checkPathOrder(DefaultFilterChainValidator.java:53)
    at org.springframework.security.config.http.DefaultFilterChainValidator.validate(DefaultFilterChainValidator.java:40)
    at org.springframework.security.web.FilterChainProxy.afterPropertiesSet(FilterChainProxy.java:167)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1642)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1579)
    ... 21 common frames omitted
org.springframework.beans.factory.BeanCreationException:创建名为“org.springframework.security.filterChainProxy”的bean时出错:调用init方法失败;嵌套的异常是java.lang.IllegalArgumentException:在筛选器链中的其他模式之前定义了一个通用匹配模式(“/**”),导致忽略它们。请检查命名空间或FilterChainProxy bean配置中的顺序
位于org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1583)
位于org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
位于org.springframework.beans.factory.support.AbstractAutowi