Skip to content

Spring security update from 5.1.x to 5.2.x breaks security configuration #7970

@manuel-g-ferreira

Description

@manuel-g-ferreira

Summary

Updated spring security to version 5.2.2-RELEASE (starting point 5.1.5-RELEASE) and the build started failing with the same code.

After updating

Actual Behavior

Build breaks


Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is java.lang.IllegalStateException: Can't configure antMatchers after anyRequest
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:651)
        ... 21 common frames omitted
Caused by: java.lang.IllegalStateException: Can't configure antMatchers after anyRequest

Expected Behavior

Build to pass


14:39:58.995 [main] INFO  o.a.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8080"]
14:39:59.008 [main] INFO  o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port(s): 8080 (http) with context path ''
14:39:59.010 [main] INFO  c.draughtmaster.core.CoreApplication - Started CoreApplication in 39.016 seconds (JVM running for 39.403)
<===========--> 87% EXECUTING [1m 11s]

Version

springBootVersion = '2.2.2.RELEASE'
org.springframework.security:spring-security-config:5.2.2.RELEASE

Metadata

Metadata

Assignees

Labels

in: configAn issue in spring-security-configstatus: invalidAn issue that we don't feel is valid

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions