오류문구 

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'messageController': Unsatisfied dependency expressed through field 'messageService'('메시지서비스' 필드에 종속성 표현이 충족되지 않는다); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'net.edupoll.kr.service.MessageService' 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.UnsatisfiedDependencyException: Error creating bean with name 'messageController': Unsatisfied dependency expressed through field 'messageService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'net.edupoll.kr.service.MessageService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

 

원인

Service 클래스에 @Service 어노테이션을 붙이지 않았음 

 

해결방법

Service 클래스에 @Service 어노테이션 붙이기 

@Service
public class MessageService {
}

+ Recent posts