inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술

스프링 데이터 JPA

UnsatisfiedDependencyException 에러

13869

최지웅

작성한 질문수 1

0

안녕하세요 김영한 강사님! 얼마 전부터 스프링을 재미있게 수강중인 취준생입니다.

스프링 데이터 JPA 예제를 따라 입력하고 회원가입과 중복회원 예외 테스트 코드를 실행하였더니, Error creating bean with name 'springConfig' defined in file [C:\SpringStudy\begin-spring\out\production\classes\hello\beginspring\SpringConfig.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springDataJpaMemberRepository' defined in hello.beginspring.repository.SpringDataJpaMemberRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.Optional hello.beginspring.repository.MemberRepository.findByID(java.lang.Long)! No property ID found for type Member! Did you mean 'id'?

위와 같은 에러가 발생하였는데, 검색으로 스스로 해결하지 못하였습니다.

SpringConfig.java

데이터 JPA가 빈을 등록할때 빈 자체를 인식하지 못하는것인지. 프로퍼티 id와 관련해서 오탈자가 있는 것인지 모르겠습니다.

어디를 보여드려야 할 지 몰라서 강의를 보며 입력한 코드의 깃허브 주소를 함께 올립니다.  

https://github.com/lilaco/begin-spring

퀄리티 높은 수업을 제공해 주셔서 감사합니다 :)

java spring-boot spring MVC

답변 1

1

김영한

안녕하세요. 지웅님

오류에 힌트가 있습니다^^

findByID -> findById로 변경해주셔야 합니다.

감사합니다.

0

최지웅

오타를 못찾아서 헤맸네요ㅠㅠ 소중한 시간 써주셔서 감사합니다!

..

0

72

2

Unused property.....

0

98

2

project JDK is misconfigured

0

128

2

외부 API의 ID 타입(String/UUID)과 내부 도메인의 ID 타입(Long)이 불일치할 때의 설계 정석

0

81

2

단위/통합 테스트 버전충돌 문제

0

91

2

❗️springboot 4.0.2 버전 aspectj dependency 설정❗️

0

226

1

왜 컨트롤러는 변한게 없는데 새로 만든 html 파일이 뜨나요?

0

101

2

윈도우 build test오류 질문

1

102

2

테스트 관련 공부에 대한 조언을 얻고 싶습니다

0

98

2

테스트 실행 시 에러 질문

0

287

1

name을 통한 비교와 객체를 통한 비교

0

77

1

빌드 후 libs 없음

1

128

1

윈도우 gradlew.bat 에러

0

166

1

@PostMapping("/members/new")가 동작하지 않습니다

0

88

1

java static class와 kotlin class

0

77

1

스프링 DB연결

0

126

1

소요 시간

0

85

2

ddl.sql에 빨간 밑줄

1

101

2

welcome page 에러

0

180

3

잘 모르겠습니다.

0

160

2

fail을 똑같이 쳤는데 오류가 발생해요

0

156

2

index.html Welcome page

0

120

1

프로젝트 gradle-groovy ?

0

362

1

테스트코드 메서드명 한글

0

193

2