작성
·
421
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)}
선생님, bean을 정의하는 부분을 다시한번 살펴보라는게 root-context.xml이랑 web.xml을 다시 살펴보라는 뜻 이신가요? java로는 실습 잘 진행하고 있는데 xml에서 계속 막혀서 제자리 걸음 중입니다. 도와주세요.