인프런 커뮤니티 질문&답변

이샘미님의 프로필 이미지
이샘미

작성한 질문수

자바와 스프링 부트로 생애 최초 서버 만들기, 누구나 쉽게 개발부터 배포까지! [서버 개발 올인원 패키지]

31강 오류요ㅠㅠ

작성

·

159

0

오류요ㅜㅜㅜ 어노테이션이나 다른 코드같은 거 잘 넣었는데..계속 문제떠요ㅜㅜ

https://github.com/alicelee1231/Spring

 

 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2024-04-01 00:42:10.261 ERROR 6648 --- [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bookController' defined in file [/Users/isaemmi/Desktop/library-app/out/production/classes/com/group/libraryapp/controller/book/BookController.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bookService' defined in file [/Users/isaemmi/Desktop/library-app/out/production/classes/com/group/libraryapp/service/book/BookService.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userLoanHistoryRepository' defined in com.group.libraryapp.domain.user.loanhistory.UserLoanHistoryRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Invocation of init method failed; nested exception is org.springframework.data.repository.query.QueryCreationException: Could not create query for public abstract boolean com.group.libraryapp.domain.user.loanhistory.UserLoanHistoryRepository.existByBookNameAndIsReturn(java.lang.String,boolean); Reason: Failed to create query for method public abstract boolean com.group.libraryapp.domain.user.loanhistory.UserLoanHistoryRepository.existByBookNameAndIsReturn(java.lang.String,boolean)! No property 'existByBookName' found for type 'UserLoanHistory'; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract boolean com.group.libraryapp.domain.user.loanhistory.UserLoanHistoryRepository.existByBookNameAndIsReturn(java.lang.String,boolean)! No property 'existByBookName' found for type 'UserLoanHistory'

at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.24.jar:5.3.24]

at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:229) ~[spring-beans-5.3.24.jar:5.3.24]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1372) ~[spring-beans-5.3.24.jar:5.3.24]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1222) ~[spring-beans-5.3.24.jar:5.3.24]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582) ~[spring-beans-5.3.24.jar:5.3.24]

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.24.jar:5.3.24]

at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.24.jar:5.3.24]

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.24.jar:5.3.24]

at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.24.jar:5.3.24]

at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.24.jar:5.3.24]

at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:955) ~[spring-beans-5.3.24.jar:5.3.24]

at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.24.jar:5.3.24]

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.24.jar:5.3.24]

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147) ~[spring-boot-2.7.6.jar:2.7.6]

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.6.jar:2.7.6]

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.6.jar:2.7.6]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.6.jar:2.7.6]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) ~[spring-boot-2.7.6.jar:2.7.6]

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) ~[spring-boot-2.7.6.jar:2.7.6]

at com.group.libraryapp.LibraryAppApplication.main(LibraryAppApplication.java:10) ~[classes/:na]

Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating be

답변 1

0

최태현님의 프로필 이미지
최태현
지식공유자

안녕하세요, 샘미님! 에러가 발생해서 많이 답답하시겠어요! 🥺

existByBookNameAndIsReturn 라는 메소드 이름 대신 existsByBookNameAndIsReturn 을 사용해보시면 좋을 것 같아요! s가 추가되어 있습니다!

꼭 해결되셨으면 좋겠습니다. 감사합니다 🙏

이샘미님의 프로필 이미지
이샘미
질문자

감사합니다.! 해결되었어요..! 이름을 맞춰주면 된다고 생각했었는데 다시 생각해보니 착각이었네요ㅜㅜ 감사합니다!

이샘미님의 프로필 이미지
이샘미

작성한 질문수

질문하기