Logs
[Error] org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 해결 방법
랩실외톨이
2023. 8. 13. 06:00
반응형
https://coding-log.tistory.com/257
사실 전에도 같은 Exception이 난적이 있다. 그런데 같은 Exception이더라도 그 원인은 천차만별인 법.
위에서 난 에러는 의존성 문제였는데 이번엔 그게 아니었다.
바로 어노테이션을 제자리에 달아주지 않아서였다. 사실 예전에도 같은 에러가 난적이 있는데 그때도 이 때문이었다.
반응형
새 파일을 만들고 코딩을 한 당신! 어노테이션을 제대로 달았나요?
Spring Boot 기준으로 체크리스트를 만들었다.
- @Entity
- @Repository
- @Service
- @RestController(@Controller)
각 클래스가 유기적으로 연결되어서 작동하기 때문에 하나라도 선언이 되어있지 않으면 서로 의존성을 찾을 수가 없어서 시위를 하는 에러인 것이다.
반응형