-
카테고리
-
세부 분야
백엔드
-
해결 여부
미해결
xml 설정파일에서 에러나는 이유 문의
22.03.03 14:34 작성 조회수 241
1
안녕하세요. 선생님. 강의 보고 스프링 프로젝트 잘 따라하고 있다가 에러가 나서 문의드립니다.
구글링을 하고 해결책을 찾아봐도 해결되지 않더라고요
서버 연결한 뒤 index 화면까지는 나오는데 이후 test 화면이나 result 화면으로 이동하려면 아래와 같은 에러가 뜹니다.
빈 주입이 안됐다는 것 같은데 root-context.xml 에서
<bean class="kr.co.softcampus.beans.DataBean1" scope="session"/>
<bean class="kr.co.softcampus.beans.DataBean2" id="sessionBean2" scope="session"/>
이렇게 넣어주었는데 왜 안되는건지 모르겠습니다.
EVERE: Servlet.service() for servlet [dispatcher] in context with path [/RequestScopeBeanXml] threw exception [Request processing failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'kr.co.softcampus.beans.DataBean1' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.context.annotation.Lazy(true)}] with root cause
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'kr.co.softcampus.beans.DataBean1' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.context.annotation.Lazy(true)}
답변을 작성해보세요.
답변 2