[Eclipse] 오류 해결 방법 ServiceImpl required a bean of type '

2023. 3. 15. 13:34에러 모음

오류 내용 ↓

더보기

***************************
APPLICATION FAILED TO START
***************************

Description:

Field mapper in com.lifelog.kakao.service.impl.KakaoServiceImpl required a bean of type 'com.lifelog.kakao.mapper.KakaoMapper' that could not be found.

The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'com.lifelog.kakao.mapper.KakaoMapper' in your configuration.

 

Impl에 해당 코드를 추가해주니 해결되었다.

@Configuration
@MapperScan("com.lifelog.kakao.mapper")

 

KakaoServiceImpl.java (일부)

@Configuration
@MapperScan("com.lifelog.kakao.mapper")
@Service("KakaoService")
public class KakaoServiceImpl implements KakaoService{
}