이 오류는 난생 처음봐서 매우 당황했던 것으로 기록을 남겨둔다.
HTTP 상태 500 – 내부 서버 오류
타입 예외 보고
메시지 서블릿 [shop]을(를) 위한 Servlet.init() 호출이 예외를 발생시켰습니다.
설명 서버가, 해당 요청을 충족시키지 못하게 하는 예기치 않은 조건을 맞닥뜨렸습니다.
[근본 원인 root cause]
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'biz';
nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type 'com.biz.UserBIZ' available: expected at least 1 bean which qualifies as autowire candidate.
Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:659)
찬찬히 읽어보면 Bean 생성을 못했다는 얘기인 듯 했고 어노테이션에 대한 얘기도 보였다.
하지만 난 분명히 @Service
와 @Autowired
를 잘 준 것 같은데...
근본 원인은 dispatcher-servlet.xml
에 있었다.
base-component
를 특정 하위 패키지에만 준 것이었다.. 그러니 Bean 생성을 못했군!
서블릿 설정 xml 파일을 잘 살펴보자!
그렇게 500 에러는 헤쳐나왔고 이젠 404 에러가 남았다. 하하!!
-끝-