Couldn't Find FilterChainProxy
https://github.com/spring-projects/spring-security/issues/14370
https://github.com/spring-projects/spring-security/commit/7cd626fe2569346b945feec40fa16f231a558fde
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain': Failed to instantiate [org.springframework.security.config.annotation.web.configuration.WebMvcSecurityConfiguration$CompositeFilterChainProxy]: Constructor threw exception
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:322) ~[spring-beans-6.1.2.jar:6.1.2]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:310) ~[spring-beans-6.1.2.jar:6.1.2]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1354) ~[spring-beans-6.1.2.jar:6.1.2]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1191) ~[spring-beans-6.1.2.jar:6.1.2]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:561) ~[spring-beans-6.1.2.jar:6.1.2]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-6.1.2.jar:6.1.2]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.2.jar:6.1.2]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.2.jar:6.1.2]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.2.jar:6.1.2]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.2.jar:6.1.2]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:312) ~[spring-beans-6.1.2.jar:6.1.2]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.2.jar:6.1.2]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975) ~[spring-beans-6.1.2.jar:6.1.2]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:960) ~[spring-context-6.1.2.jar:6.1.2]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:625) ~[spring-context-6.1.2.jar:6.1.2]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.1.jar:3.2.1]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) ~[spring-boot-3.2.1.jar:3.2.1]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:464) ~[spring-boot-3.2.1.jar:3.2.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[spring-boot-3.2.1.jar:3.2.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1358) ~[spring-boot-3.2.1.jar:3.2.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1347) ~[spring-boot-3.2.1.jar:3.2.1]
at com.example.uptime.SpringBootUptimeApplication.main(SpringBootUptimeApplication.java:23) ~[main/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.config.annotation.web.configuration.WebMvcSecurityConfiguration$CompositeFilterChainProxy]: Constructor threw exception
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:223) ~[spring-beans-6.1.2.jar:6.1.2]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:111) ~[spring-beans-6.1.2.jar:6.1.2]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:319) ~[spring-beans-6.1.2.jar:6.1.2]
... 21 common frames omitted
Caused by: java.lang.IllegalStateException: Couldn't find FilterChainProxy in [org.springframework.web.servlet.handler.HandlerMappingIntrospector$$Lambda$881/0x000001d78949a2d0@6b2fdffc, org.springframework.security.web.debug.DebugFilter@2ca3d826]
at org.springframework.security.config.annotation.web.configuration.WebMvcSecurityConfiguration$CompositeFilterChainProxy.findFilterChainProxy(WebMvcSecurityConfiguration.java:302) ~[spring-security-config-6.2.1.jar:6.2.1]
at org.springframework.security.config.annotation.web.configuration.WebMvcSecurityConfiguration$CompositeFilterChainProxy.<init>(WebMvcSecurityConfiguration.java:214) ~[spring-security-config-6.2.1.jar:6.2.1]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[na:na]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:210) ~[spring-beans-6.1.2.jar:6.1.2]
... 23 common frames omitted
์ค๋ฅ์์ธ
์คํ๋ง ๋ถํธ 3.1.5 ๋ถํฐ 3.2.1 ๊น์ง์ ๋ฒ์ ์์ @EnableWebSecurity์ debug ์ต์ ์ ํ์ฑํํ๋ ๊ฒฝ์ฐ FilterChainProxy ๊ฐ ์๋ DebugFilter๊ฐ ๋ฑ๋ก๋์ด ์ ํ๋ฆฌ์ผ์ด์ ์ปจํ ์คํธ ๊ตฌ์ฑ ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ ๋ฌธ์ ๊ฐ ์๋ค๋ ์์์ด๋ค. ์คํ๋ง ๋ถํธ์ ํจ๊ป ์คํ๋ง ์ํ๋ฆฌํฐ์ ๋ํด์ ํ์ตํ๋ ๊ฐ๋ฐ์์๊ฒ๋ ์๊ฐ๋ณด๋ค ํฐ ์ด์์ผ ์๋ ์์ด๋ณด์ธ๋ค.
ํด๊ฒฐ๋ฐฉ์
ext['spring-security.version'] = '6.2.2'
์ด ๊ธ์ ์์ฑํ๋ 2023๋ 12์ 29์ผ ๊ธฐ์ค์ผ๋ก ์คํ๋ง ์ํ๋ฆฌํฐ 6.1.7 ๋๋ 6.2.2 ๋ฒ์ ์ด ๋ฆด๋ฆฌ์ฆ ๋์ง ์์ ์ํ์ด๋ค. ๊ทธ๋์ ๊ธํ๊ฒ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๊ณ ์ถ๋ค๋ฉด ์๋์ ๊ฐ์ ์์ ์กฐ์น๊ฐ ํ์ํ๋ค.
- @EnableWebSecurity์ debug ์ต์ ์ ์ฌ์ฉํ์ง ์์ (๋ก๊ทธ ๋ ๋ฒจ๋ก ๋์ฒด)
- Spring Boot 3.1.4 ์ดํ์ ๋ฒ์ ์ ์ฌ์ฉ