JAVA/오류해결

[Spring Boot][오류해결] Parameter 0 of constructor in ~~ required a bean of type ~~ that could not be found.

gakko 2022. 2. 14. 12:00

에러상황


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

Description:

Parameter 0 of constructor in com.bigbell.accountbook.rest.AccountRestController required a bean of type 'com.bigbell.accountbook.service.TodayAccountService' that could not be found.


Action:

Consider defining a bean of type 'com.bigbell.accountbook.service.TodayAccountService' in your configuration.

 


 

위 에러는 Entity, Service, DAO를 구성할 때 생길 수 있는 에러이다.

내용은 Bean이 발견되지 않는다는 건데 클래스 위에 빈을 식별하게 도와주는 어노테이션을 넣지 않아서 그런 것이다.

 

엔티티 클래스 위에 @Entity 어노테이션

Sevice 클래스 위에 @Service 어노테이션

DAO 클래스 위에 @Repository 어노테이션

 

가 있는지 다시 한 번 확인해보자.