Exception "A universal match pattern ('/**') is defined before other patterns in the filter chain"

Hi ,
I created two projetct,one is a “Base” project and pulished as an app component, another is a general project and depend on the “Base” project.

All of two projects have “Portal” block, when start the general project,it will throws an exeption when starting portal block. the root exception is :

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

Following screenshot showing the spring config files for the portal app.


The “Base” project’s portal block can works .

Anybody can give some suggestions about this problem?

Helo @lugreen

Could you share the content of portal-spring-security.xml files?


Hi Daniil ,

The portal-spring-security.xml in cuba framework is empty.
The portal-spring-security.xml in my base project is following:
portal-security-spring.xml (2.6 KB)

The portal-security-spring.xml file is generated from template, but i have made some changes to it.

It seems that problem is related to security config of the general project. Could you also share it portal-spring-security.xml file?

Sure, here:

portal-security-spring.xml (1.9 KB)

Thank you.

In fact problem is caused by configurations overlay. In other words security patterns are added sequentially:

  1. CUBA config
  2. App comp config
  3. Project config

CUBA has no security config for portal module. Since app component config has wildcard pattern, all other patterns configured in project will be ignored.

As an option you can expose custom security config when project is used app component.


1 Like

Hi Daniil ,
Tanks for your explain.

Now i understood, and i think not only the portal-spring-security.xml is overlaid , the “portal-dispatcher-spring.xml” and “portal-spring.xml” are reduplicative in app component and normal project also . I clean the spring config in normal project, now the project can start.