본문 바로가기

오류&해결

[spring]No bean named 'springSecurityFilterChain' available 오류

No bean named 'springSecurityFilterChain' available

'springSecurityFilterChain' 이라는 bean이 제대로 설정되지 않아서 생기는 오류이다.

스프링 시큐리티의 설정 파일을 찾을 수 없기 때문이다.

 

--기존코드
<context-param>
	<param-name>contextConfigLocation</param-name>
	<param-value>/WEB-INF/spring/root-context.xml
	</param-value>
</context-param>

 

기존에 있던 root-context.xml 로딩하도록 설정하는 작업에 security-context.xml 설정하는 작업만 추가하면 되는데..

따로 작성을 해서 오류가 생겼다ㅠㅠ 흑흑

이거 찾는데 1시간...ㅎㅎ

 

 

Web.xml  

--수정코드
<context-param>
	<param-name>contextConfigLocation</param-name>
	<param-value>/WEB-INF/spring/root-context.xml
	/WEB-INF/spring/security-context.xml -> 추가
	</param-value>
</context-param>

 

Security-context.xml

<?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/security 
  http://www.springframework.org/schema/security/spring-security.xsd 
  http://www.springframework.org/schema/beans 
  http://www.springframework.org/schema/beans/spring-beans.xsd">
 
 <security:http>  -> 추가
  <security:form-login/>
 </security:http>
 <security:authentication-manager>
 </security:authentication-manager>  
 
</beans>

 

이렇게 작성을 하고 나니 또 다른 오류가 생겼다..

org.apache.jasper.JasperException: JSP 

이건 뭐지?????????? 아래글 참고참고

 

https://carrotdy.tistory.com/16

 

[spring]org.apache.jasper.JasperException: JSP 오류

org.apache.jasper.JasperException: JSP 톰캣 실행에서 나는 오류인듯하다.. server -> 오른쪽 마우스클릭 -> clean -> 그리고 서버를 재시작 해주면 정상으로 작동이 된다.

carrotdy.tistory.com

 

반응형