org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined

추민석·2021년 5월 15일
0
post-thumbnail

version

java : 1.7
spring : 3.1.1
spring security : 3.1.0


기본적인 Spring Security 실습을 위해서 기본 설정중 저러한 에러...
시키는 대로 했는데 저런 오류가 났다

spring security context.xml 파일의 위치 설정,
maven clean ..등등 시키는 대로 했지만 나같은 경우 해결이 되지 않았다.

Spring Bean Configuration File 생성 후 namespace에 security 추가하면 다음과 같았다.


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

위의 코드를

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans
	xmlns="http://www.springframework.org/schema/security"
	xmlns:beans="http://www.springframework.org/schema/beans"
	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-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd">

...
</beans>

왜 저렇게 바꾸니까 실행이 되는지는 아직도 의문..

로 변경하니 성공...!

profile
풋내기개발자

0개의 댓글