반응형
org.springframework.beans.factory.NoSuchBeanDefinitionException:
No matching bean of type [com.yu.springex.content.service.ContentServiceImpl]
found for dependency: expected at least 1 bean which qualifies as autowire candidate
for this dependency. Dependency annotations:
{@org.springframework.beans.factory.annotation.Autowired(required=true)}
@Service 어노테이션을 붙이지 않아도 해당 오류가 뜬다.
그래서 아래 부분을 수정해줬다.
@Service
public class ContentServiceImpl {
@Autowired
ContentSQLMapper contentSQLMapper;
public void writeContent(ContentVo vo) {
contentSQLMapper.insert(vo);
}
반응형