본문 바로가기
Framework | Test/Spring

[Srping] Error : The prefix "context" for element "context:component-scan" is not bound

by Baest 2021. 8. 3.

xml 에 bean을 추가하려고 했는데 <context:component - scan> 부분에서 에러가 발생했다.

 

 

검색해 보니 beans 의 xmls 선언 부분에 context에 대한 내용이 없어서 발생된 것이라고 한다.

 

해결 방법은 

1) 직접 아래 내용을 추가하거나

xmlns:context="http://www.springframework.org/schema/context"

 

2) Namespaces에서 context 부분을 체크하면 자동으로 입력됨

 

Namespaces 에서 context 선택 후 에러 해결되었음! (7번째 줄에 context 관련 내용 추가됨)